Revision 1098cb94
Added by Viktor Gurov over 3 years ago
src/usr/local/www/services_igmpproxy.php | ||
---|---|---|
56 | 56 |
$pconfig['igmpxverbose'] = isset($config['syslog']['igmpxverbose']); |
57 | 57 |
|
58 | 58 |
if ($_POST['save']) { |
59 |
unset($input_errors); |
|
59 | 60 |
$pconfig = $_POST; |
61 |
|
|
60 | 62 |
if (isset($pconfig['enable'])) { |
61 |
$config['igmpproxy']['enable'] = true; |
|
62 |
} else { |
|
63 |
unset($config['igmpproxy']['enable']); |
|
63 |
if (is_array($config['igmpproxy']['igmpentry']) && |
|
64 |
!empty($config['igmpproxy']['igmpentry'])) { |
|
65 |
foreach ($config['igmpproxy']['igmpentry'] as $igmpcf) { |
|
66 |
if ($igmpcf['type'] == 'upstream') { |
|
67 |
$upstream = true; |
|
68 |
} else { |
|
69 |
$downstream = true; |
|
70 |
} |
|
71 |
} |
|
72 |
} |
|
73 |
if (!$upstream || !$downstream) { |
|
74 |
$input_errors[] = gettext("At least one upstream and one downstream interface must be added."); |
|
75 |
} |
|
76 |
} |
|
77 |
|
|
78 |
if (!$input_errors) { |
|
79 |
if (isset($pconfig['enable'])) { |
|
80 |
$config['igmpproxy']['enable'] = true; |
|
81 |
} else { |
|
82 |
unset($config['igmpproxy']['enable']); |
|
83 |
} |
|
84 |
$config['syslog']['igmpxverbose'] = $_POST['igmpxverbose'] ? true : false; |
|
85 |
write_config("IGMP Proxy settings saved"); |
|
86 |
mark_subsystem_dirty('igmpproxy'); |
|
87 |
header("Location: services_igmpproxy.php"); |
|
88 |
exit; |
|
64 | 89 |
} |
65 |
$config['syslog']['igmpxverbose'] = $_POST['igmpxverbose'] ? true : false; |
|
66 |
write_config("IGMP Proxy settings saved"); |
|
67 |
mark_subsystem_dirty('igmpproxy'); |
|
68 |
header("Location: services_igmpproxy.php"); |
|
69 |
exit; |
|
70 | 90 |
} |
71 | 91 |
|
72 | 92 |
if ($_POST['act'] == "del") { |
... | ... | |
82 | 102 |
$pgtitle = array(gettext("Services"), gettext("IGMP Proxy")); |
83 | 103 |
include("head.inc"); |
84 | 104 |
|
105 |
if ($input_errors) { |
|
106 |
print_input_errors($input_errors); |
|
107 |
} |
|
108 |
|
|
85 | 109 |
if ($changes_applied) { |
86 | 110 |
print_apply_result_box($retval); |
87 | 111 |
} |
Also available in: Unified diff
IGMP Proxy service improvements. Fixes #12609