Commit 1d73b3b5 authored by Franco Fichtner's avatar Franco Fichtner

plugins: follow the footsteps of plugins_syslog() and plugins_services()

This looks simple enough now.  Discussed with @adschellevis.
parent 74870bbf
......@@ -177,9 +177,15 @@ function write_config($desc = '', $backup = true)
return -1;
}
if (function_exists('plugins_interfaces')) {
/* only pull plugins if plugins.inc was included before */
plugins_interfaces(false);
}
$cnf = OPNsense\Core\Config::getInstance();
$cnf->fromArray($config);
$revision_info = make_config_revision_entry($desc);
try {
$cnf->save($revision_info, $backup);
} catch (OPNsense\Core\ConfigException $e) {
......
......@@ -732,7 +732,6 @@ function step12_submitphpaction()
$config['openvpn']['openvpn-server'][] = $server;
openvpn_resync('server', $server);
plugins_interfaces(false);
write_config();
header("Location: vpn_openvpn_server.php");
exit;
......
......@@ -53,7 +53,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
}
}
unset($a_ifgroups[$id]);
plugins_interfaces(false);
write_config();
header("Location: interfaces_groups.php");
exit;
......
......@@ -125,7 +125,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
// add new item
$a_ifgroups[] = $ifgroupentry;
}
plugins_interfaces(false);
write_config();
interface_group_setup($ifgroupentry);
header("Location: interfaces_groups.php");
......
......@@ -88,7 +88,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
} elseif (isset($config['ipsec']['enable'])) {
unset($config['ipsec']['enable']);
}
plugins_interfaces(false);
write_config();
ipsec_configure();
filter_configure();
......@@ -118,7 +117,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
unset($config['ipsec']['phase1'][$p1entrydel]);
}
plugins_interfaces(false);
write_config();
mark_subsystem_dirty('ipsec');
header("Location: vpn_ipsec.php");
......
......@@ -170,10 +170,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$config['ipsec']['client'] = $client;
plugins_interfaces(false);
write_config();
mark_subsystem_dirty('ipsec');
header(url_safe('Location: vpn_ipsec_mobile.php'));
exit;
}
......
......@@ -387,7 +387,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
}
plugins_interfaces(false);
write_config();
mark_subsystem_dirty('ipsec');
header("Location: vpn_ipsec.php");
......
......@@ -135,7 +135,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (isset($id)) {
openvpn_delete('client', $a_client[$id]);
unset($a_client[$id]);
plugins_interfaces(false);
write_config();
}
header("Location: vpn_openvpn_client.php");
......@@ -148,7 +147,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
unset($a_client[$rulei]);
}
}
plugins_interfaces(false);
write_config();
}
header("Location: vpn_openvpn_client.php");
......@@ -339,7 +337,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
openvpn_resync('client', $client);
plugins_interfaces(false);
write_config();
header("Location: vpn_openvpn_client.php");
......
......@@ -139,7 +139,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (isset($a_server[$id])) {
openvpn_delete('server', $a_server[$id]);
unset($a_server[$id]);
plugins_interfaces(false);
write_config();
}
header("Location: vpn_openvpn_server.php");
......@@ -404,7 +403,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
openvpn_resync('server', $server);
plugins_interfaces(false);
write_config();
openvpn_resync_csc(); // dump client specific overrides, the required set may have changed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment