diff --git a/src/www/interfaces_groups.php b/src/www/interfaces_groups.php index c005a8feb..89ee5cf3d 100644 --- a/src/www/interfaces_groups.php +++ b/src/www/interfaces_groups.php @@ -30,6 +30,8 @@ require_once("guiconfig.inc"); require_once("interfaces.inc"); +require_once("filter.inc"); +require_once("system.inc"); $a_ifgroups = &config_read_array('ifgroups', 'ifgroupentry'); @@ -38,7 +40,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $id = $_POST['id']; } - if (!empty($_POST['action']) && $_POST['action'] == "del" && isset($id)) { + if (isset($_POST['apply'])) { + system_cron_configure(); + filter_configure(); + clear_subsystem_dirty('filter'); + $savemsg = gettext('The settings have been applied and the rules are now reloading in the background.'); + } elseif (!empty($_POST['action']) && $_POST['action'] == "del" && isset($id)) { $members = explode(" ", $a_ifgroups[$id]['members']); foreach ($members as $ifs) { mwexecf('/sbin/ifconfig %s -group %s', array(get_real_interface($ifs), $a_ifgroups[$id]['ifname'])); @@ -92,6 +99,11 @@ $main_buttons = array(
+ + +

+ You must apply the changes in order for them to take effect."));?> +

diff --git a/src/www/interfaces_groups_edit.php b/src/www/interfaces_groups_edit.php index be00c9e22..a0009c34c 100644 --- a/src/www/interfaces_groups_edit.php +++ b/src/www/interfaces_groups_edit.php @@ -30,6 +30,7 @@ require_once("guiconfig.inc"); require_once("interfaces.inc"); +require_once("filter.inc"); $a_ifgroups = &config_read_array('ifgroups', 'ifgroupentry'); @@ -112,6 +113,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { } } } + mark_subsystem_dirty('filter'); } $old_ifname = isset($id) ? $a_ifgroups[$id]['ifname'] : $pconfig['ifname']; // remove group members @@ -123,9 +125,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { // update item $a_ifgroups[$id] = $ifgroupentry; } else { + mark_subsystem_dirty('filter'); // add new item $a_ifgroups[] = $ifgroupentry; } + usort($a_ifgroups, function($a, $b) { + return strnatcmp($a['ifname'], $b['ifname']); + }); + filter_rules_sort(); write_config(); interface_group_setup($ifgroupentry); header(url_safe('Location: /interfaces_groups.php'));