summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/services_dhcpv6.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2017-01-03 10:50:22 +0545
committerPhil Davis <phil.davis@inf.org>2017-01-03 10:50:22 +0545
commit44c423566b6eff18ec43ee77edddb94e3a3aa858 (patch)
treeec35ff8f9243236c75e9b120b80a2f62251ad5d8 /src/usr/local/www/services_dhcpv6.php
parent46c06ade87cbea59d1113a23a5d91f15dab9048c (diff)
downloadpfsense-44c423566b6eff18ec43ee77edddb94e3a3aa858.zip
pfsense-44c423566b6eff18ec43ee77edddb94e3a3aa858.tar.gz
Report problems applying changes
1) Strictly keep track of the accumulating $retval from calls to various functions that apply changes. 2) Use new function print_apply_result_box() to print a suitable message in a suitable severity based on $retval
Diffstat (limited to 'src/usr/local/www/services_dhcpv6.php')
-rw-r--r--src/usr/local/www/services_dhcpv6.php20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/usr/local/www/services_dhcpv6.php b/src/usr/local/www/services_dhcpv6.php
index 44afcc4..820f89b 100644
--- a/src/usr/local/www/services_dhcpv6.php
+++ b/src/usr/local/www/services_dhcpv6.php
@@ -44,30 +44,30 @@ function dhcpv6_apply_changes($dhcpdv6_enable_changed) {
/* dnsmasq_configure calls dhcpd_configure */
/* no need to restart dhcpd twice */
if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) {
- $retvaldns = services_dnsmasq_configure();
+ $retvaldns |= services_dnsmasq_configure();
if ($retvaldns == 0) {
clear_subsystem_dirty('hosts');
clear_subsystem_dirty('staticmaps');
}
} else if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic'])) {
- $retvaldns = services_unbound_configure();
+ $retvaldns |= services_unbound_configure();
if ($retvaldns == 0) {
clear_subsystem_dirty('unbound');
clear_subsystem_dirty('staticmaps');
}
} else {
- $retvaldhcp = services_dhcpd_configure();
+ $retvaldhcp |= services_dhcpd_configure();
if ($retvaldhcp == 0) {
clear_subsystem_dirty('staticmaps');
}
}
if ($dhcpdv6_enable_changed) {
- $retvalfc = filter_configure();
+ $retvalfc |= filter_configure();
}
if ($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1) {
$retval = 1;
}
- return get_std_save_message($retval);
+ return $retval;
}
if (!$g['services_dhcp_server_enable']) {
@@ -184,7 +184,8 @@ if (is_array($dhcrelaycfg) && isset($dhcrelaycfg['enable']) && isset($dhcrelaycf
}
if (isset($_POST['apply'])) {
- $savemsg = dhcpv6_apply_changes(false);
+ $changes_applied = true;
+ $retval = dhcpv6_apply_changes(false);
} elseif (isset($_POST['save'])) {
unset($input_errors);
@@ -459,7 +460,8 @@ if (isset($_POST['apply'])) {
write_config();
- $savemsg = dhcpv6_apply_changes($dhcpdv6_enable_changed);
+ $changes_applied = true;
+ $retval = dhcpv6_apply_changes($dhcpdv6_enable_changed);
}
}
@@ -492,8 +494,8 @@ if ($input_errors) {
print_input_errors($input_errors);
}
-if ($savemsg) {
- print_info_box($savemsg, 'success');
+if ($changes_applied) {
+ print_apply_result_box($retval);
}
if (is_subsystem_dirty('staticmaps')) {
OpenPOWER on IntegriCloud