summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/services_dhcp.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_dhcp.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_dhcp.php')
-rw-r--r--src/usr/local/www/services_dhcp.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php
index 426f1c3..db5ce1c 100644
--- a/src/usr/local/www/services_dhcp.php
+++ b/src/usr/local/www/services_dhcp.php
@@ -610,39 +610,38 @@ if (isset($_POST['save'])) {
}
if ((isset($_POST['save']) || isset($_POST['apply'])) && (!$input_errors)) {
+ $changes_applied = true;
$retval = 0;
$retvaldhcp = 0;
$retvaldns = 0;
/* 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('hosts');
clear_subsystem_dirty('staticmaps');
}
} else {
- $retvaldhcp = services_dhcpd_configure();
+ $retvaldhcp |= services_dhcpd_configure();
if ($retvaldhcp == 0) {
clear_subsystem_dirty('staticmaps');
}
}
if ($dhcpd_enable_changed) {
- $retvalfc = filter_configure();
+ $retvalfc |= filter_configure();
}
if ($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1) {
$retval = 1;
}
-
- $savemsg = get_std_save_message($retval);
}
if ($act == "delpool") {
@@ -733,8 +732,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