Commit d8c7c822 authored by Franco Fichtner's avatar Franco Fichtner

igmp proxy: immediately reload, no need for subsystem/apply magic

parent 44aaac4a
...@@ -33,32 +33,29 @@ require_once("guiconfig.inc"); ...@@ -33,32 +33,29 @@ require_once("guiconfig.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
require_once("services.inc"); require_once("services.inc");
if (!isset($config['igmpproxy']['igmpentry'])) { $a_igmpproxy = array();
$config['igmpproxy']['igmpentry'] = array(); if (isset($config['igmpproxy']['igmpentry'])) {
$a_igmpproxy = &$config['igmpproxy']['igmpentry'];
} }
$a_igmpproxy = &$config['igmpproxy']['igmpentry'];
if ($_SERVER['REQUEST_METHOD'] === 'POST') { if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_POST['act']) && $_POST['act'] == "del") { if (isset($_POST['act']) && $_POST['act'] == "del") {
if (isset($_POST['id']) && !empty($a_igmpproxy[$_POST['id']])){ if (isset($_POST['id']) && !empty($a_igmpproxy[$_POST['id']])){
unset($a_igmpproxy[$_POST['id']]); unset($a_igmpproxy[$_POST['id']]);
write_config(); write_config();
mark_subsystem_dirty('igmpproxy'); igmpproxy_configure_do();
} }
exit;
} else {
/* reload all components that use igmpproxy */
igmpproxy_configure_do();
clear_subsystem_dirty('igmpproxy');
header(url_safe('Location: /services_igmpproxy.php')); header(url_safe('Location: /services_igmpproxy.php'));
exit; exit;
} }
} }
$service_hook = 'igmpproxy';
include("head.inc"); include("head.inc");
legacy_html_escape_form_data($a_igmpproxy); legacy_html_escape_form_data($a_igmpproxy);
$main_buttons = array( $main_buttons = array(
array('label' => gettext('Add a new IGMP entry'), 'href' => 'services_igmpproxy_edit.php'), array('label' => gettext('Add a new IGMP entry'), 'href' => 'services_igmpproxy_edit.php'),
); );
...@@ -97,9 +94,6 @@ $main_buttons = array( ...@@ -97,9 +94,6 @@ $main_buttons = array(
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php if (is_subsystem_dirty('igmpproxy')): ?><br/>
<?php print_info_box_apply(gettext("The IGMP entry list has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));?>
<?php endif; ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box">
<form method="post" name="iform" id="iform"> <form method="post" name="iform" id="iform">
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
*/ */
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("services.inc");
if (!isset($config['igmpproxy']['igmpentry'])) { if (!isset($config['igmpproxy']['igmpentry'])) {
$config['igmpproxy']['igmpentry'] = array(); $config['igmpproxy']['igmpentry'] = array();
...@@ -93,8 +94,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -93,8 +94,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
write_config(); write_config();
igmpproxy_configure_do();
mark_subsystem_dirty('igmpproxy');
header(url_safe('Location: /services_igmpproxy.php')); header(url_safe('Location: /services_igmpproxy.php'));
exit; exit;
} }
......
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