From a368a026db2e79ef7c48f5db0fbff27da5468c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Tue, 30 Jun 2009 17:11:30 +0000 Subject: * Reorganize the 'apply' button infrustructure in the GUI. - Present three new functions is/mark/clear_subsystem_dirty('name_of_subsystem'). This makes easier to create such things without needing to introduce new globals. - Convert all pages to the new infrustructure - This improves a lot the control on this notification --- etc/inc/config.inc | 4 +-- etc/inc/util.inc | 27 +++++++++++++++++- etc/rc.firmware | 16 +++++------ etc/rc.initial.firmware_update | 20 ++++++------- usr/local/www/firewall_aliases.php | 10 +++---- usr/local/www/firewall_aliases_edit.php | 2 +- usr/local/www/firewall_nat.php | 12 ++++---- usr/local/www/firewall_nat_1to1.php | 10 +++---- usr/local/www/firewall_nat_1to1_edit.php | 2 +- usr/local/www/firewall_nat_edit.php | 4 +-- usr/local/www/firewall_nat_out.php | 12 ++++---- usr/local/www/firewall_nat_out_edit.php | 2 +- usr/local/www/firewall_nat_server.php | 10 +++---- usr/local/www/firewall_nat_server_edit.php | 2 +- usr/local/www/firewall_rules.php | 13 ++++----- usr/local/www/firewall_rules_edit.php | 2 +- usr/local/www/firewall_shaper.php | 16 +++++------ usr/local/www/firewall_shaper_layer7.php | 12 ++++---- usr/local/www/firewall_shaper_queues.php | 8 +++--- usr/local/www/firewall_shaper_vinterface.php | 18 ++++++------ usr/local/www/firewall_shaper_wizards.php | 6 ++-- usr/local/www/firewall_virtual_ip.php | 6 ++-- usr/local/www/firewall_virtual_ip_edit.php | 2 +- usr/local/www/guiconfig.inc | 33 ++-------------------- usr/local/www/interfaces.php | 13 ++++----- usr/local/www/load_balancer_monitor.php | 6 ++-- usr/local/www/load_balancer_monitor_edit.php | 2 +- usr/local/www/load_balancer_pool.php | 6 ++-- usr/local/www/load_balancer_pool_edit.php | 2 +- usr/local/www/load_balancer_relay_action.php | 6 ++-- usr/local/www/load_balancer_relay_action_edit.php | 2 +- usr/local/www/load_balancer_relay_protocol.php | 6 ++-- .../www/load_balancer_relay_protocol_edit.php | 2 +- usr/local/www/load_balancer_virtual_server.php | 6 ++-- .../www/load_balancer_virtual_server_edit.php | 2 +- usr/local/www/services_captiveportal_ip.php | 11 +++----- usr/local/www/services_captiveportal_ip_edit.php | 2 +- usr/local/www/services_captiveportal_mac.php | 11 +++----- usr/local/www/services_captiveportal_mac_edit.php | 2 +- usr/local/www/services_dhcp.php | 18 +++++------- usr/local/www/services_dhcp_edit.php | 4 +-- usr/local/www/services_dnsmasq.php | 12 ++++---- .../www/services_dnsmasq_domainoverride_edit.php | 2 +- usr/local/www/services_dnsmasq_edit.php | 2 +- usr/local/www/services_proxyarp.php | 10 +++---- usr/local/www/services_proxyarp_edit.php | 2 +- usr/local/www/system_advanced_sysctl.php | 8 +++--- usr/local/www/system_firmware.php | 22 +++++++-------- usr/local/www/system_gateway_groups.php | 11 +++----- usr/local/www/system_gateway_groups_edit.php | 2 +- usr/local/www/system_gateways.php | 11 +++----- usr/local/www/system_gateways_edit.php | 2 +- usr/local/www/system_routes.php | 11 +++----- usr/local/www/system_routes_edit.php | 2 +- usr/local/www/vpn_ipsec.php | 6 ++-- usr/local/www/vpn_ipsec_mobile.php | 8 +++--- usr/local/www/vpn_ipsec_phase1.php | 2 +- usr/local/www/vpn_ipsec_phase2.php | 2 +- usr/local/www/vpn_l2tp_users.php | 2 +- usr/local/www/vpn_pppoe_users.php | 8 +++--- usr/local/www/vpn_pptp_users.php | 8 +++--- usr/local/www/vpn_pptp_users_edit.php | 2 +- usr/local/www/wizards/traffic_shaper_wizard.inc | 4 +-- .../wizards/traffic_shaper_wizard_dedicated.inc | 4 +-- .../wizards/traffic_shaper_wizard_multi_all.inc | 4 +-- .../wizards/traffic_shaper_wizard_multi_lan.inc | 4 +-- 66 files changed, 229 insertions(+), 272 deletions(-) diff --git a/etc/inc/config.inc b/etc/inc/config.inc index a6e871a..c8853fa 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -478,7 +478,7 @@ function conf_mount_ro() { return; /* firmare upgrade in progress */ - if(file_exists($g['varrun_path'] . "/firmware.lock")) + if (is_subsystem_dirty('firmwarelock')) return; /* do not umount if generating ssh keys */ @@ -1298,4 +1298,4 @@ function set_device_perms() { if($g['booting']) echo "."; $config = parse_config(); -?> \ No newline at end of file +?> diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 2f75728..21af5f5 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -77,6 +77,31 @@ function killbyname($procname) { mwexec("/usr/bin/killall " . escapeshellarg($procname)); } +function is_subsystem_dirty($subsystem = "") { + global $g; + + if ($subsystem == "") + return false; + + if (file_exists("{$g['varrun_path']}/{$subsystem}.dirty")) + return true; + + return false; +} + +function mark_subsystem_dirty($subsystem = "") { + global $g; + + if (!file_put_contents("{$g['varrun_path']}/{$subsystem}.dirty", "DIRTY")) + log_error("WARNING: Could not mark subsystem: {$subsytem} dirty"); +} + +function clear_subsystem_dirty($subsystem = "") { + global $g; + + @unlink("{$g['varrun_path']}/{$subsystem}.dirty"); +} + function config_lock() { log_error("config_lock() is depricated please use lock()."); return; @@ -992,4 +1017,4 @@ function isAjax() { } -?> \ No newline at end of file +?> diff --git a/etc/rc.firmware b/etc/rc.firmware index 7d31383..f9e817d 100755 --- a/etc/rc.firmware +++ b/etc/rc.firmware @@ -117,7 +117,7 @@ enable) echo "" > /cf/upgrade_log.txt ;; auto) - touch /var/run/firmware.lock + touch /var/run/firmwarelock.dirty backup_chflags remove_chflags /etc/rc.firmware_auto @@ -140,7 +140,7 @@ pfSenseNanoBSDupgrade) exit 1 fi - touch /var/run/firmware.lock + touch /var/run/firmwarelock.dirty echo "NanoBSD Firmware upgrade in progress..." >> /cf/upgrade_log.txt 2>&1 echo "NanoBSD Firmware upgrade in progress..." | wall @@ -216,7 +216,7 @@ pfSenseNanoBSDupgrade) /sbin/fsck_ffs -y /dev/$COMPLETE_PATH >> /cf/upgrade_log.txt 2>&1 if [ $? != 0 ]; then file_notice "UpgradeFailure" "{\$g['product_name']} upgrade has failed. Your system has been left in a usable state." - rm /var/run/firmware.lock + rm /var/run/firmwarelock.dirty /etc/rc.conf_mount_ro exit 1 fi @@ -248,7 +248,7 @@ pfSenseNanoBSDupgrade) if [ $? != 0 ]; then echo "Something went wrong when trying to update the fstab entry. Aborting upgrade." file_notice "UpgradeFailure" "Something went wrong when trying to update the fstab entry. Aborting upgrade." - rm /var/run/firmware.lock + rm /var/run/firmwarelock.dirty umount /tmp/$GLABEL_SLICE /etc/rc.conf_mount_ro exit 1 @@ -290,7 +290,7 @@ pfSenseNanoBSDupgrade) echo "/sbin/sysctl kern.geom.debugflags=0" >> /cf/upgrade_log.txt /sbin/sysctl kern.geom.debugflags=0 >> /cf/upgrade_log.txt 2>&1 - rm -f /var/run/firmware.lock + rm -f /var/run/firmwarelock.dirty sh /etc/rc.reboot ;; @@ -311,7 +311,7 @@ pfSenseupgrade) echo "NanoBSD upgrade starting" >> /cf/upgrade_log.txt echo "" >> /cf/upgrade_log.txt - touch /var/run/firmware.lock + touch /var/run/firmwarelock.dirty touch /cf/upgrade_log.txt echo "" >> /cf/upgrade_log.txt @@ -388,7 +388,7 @@ pfSenseupgrade) /etc/rc.conf_mount_ro # release the firmware lock - rm -f /var/run/firmware.lock + rm -f /var/run/firmwarelock.dirty /bin/sync # If the archive has unpacked a file called @@ -403,7 +403,7 @@ pfSenseupgrade) ;; delta_update) - touch /var/run/firmware.lock + touch /var/run/firmwarelock.dirty backup_chflags remove_chflags binary_update $IMG diff --git a/etc/rc.initial.firmware_update b/etc/rc.initial.firmware_update index ec8aad5..cdbaa9b 100755 --- a/etc/rc.initial.firmware_update +++ b/etc/rc.initial.firmware_update @@ -2,18 +2,15 @@ \ No newline at end of file +?> diff --git a/usr/local/www/firewall_aliases.php b/usr/local/www/firewall_aliases.php index c0701f6..76c473e 100755 --- a/usr/local/www/firewall_aliases.php +++ b/usr/local/www/firewall_aliases.php @@ -61,10 +61,8 @@ if ($_POST) { $savemsg = get_std_save_message($retval); else $savemsg = $retval; - if ($retval == 0) { - if (file_exists($d_aliasesdirty_path)) - unlink($d_aliasesdirty_path); - } + if ($retval == 0) + clear_subsystem_dirty('aliases'); } } @@ -141,7 +139,7 @@ if ($_GET['act'] == "del") { unset($a_aliases[$_GET['id']]); write_config(); filter_configure(); - touch($d_aliasesdirty_path); + mark_subsystem_dirty('aliases'); header("Location: firewall_aliases.php"); exit; } @@ -157,7 +155,7 @@ include("head.inc");
-

+

You must apply the changes in order for them to take effect.");?> diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php index 5971283..6865d47 100755 --- a/usr/local/www/firewall_aliases_edit.php +++ b/usr/local/www/firewall_aliases_edit.php @@ -221,7 +221,7 @@ if ($_POST) { else $a_aliases[] = $alias; - touch($d_aliasesdirty_path); + mark_subsystem_dirty('aliases'); write_config(); filter_configure(); diff --git a/usr/local/www/firewall_nat.php b/usr/local/www/firewall_nat.php index 9bcc2e6..741e15a 100755 --- a/usr/local/www/firewall_nat.php +++ b/usr/local/www/firewall_nat.php @@ -69,10 +69,8 @@ if ($_POST) { $retval |= filter_configure(); if ($retval == 0) { - if (file_exists($d_natconfdirty_path)) - unlink($d_natconfdirty_path); - if (file_exists($d_filterconfdirty_path)) - unlink($d_filterconfdirty_path); + clear_subsystem_dirty('natconf'); + clear_subsystem_dirty('filter'); } } @@ -86,7 +84,7 @@ if (isset($_POST['del_x'])) { unset($a_nat[$rulei]); } write_config(); - touch($d_natconfdirty_path); + mark_subsystem_dirty('natconf'); header("Location: firewall_nat.php"); exit; } @@ -129,7 +127,7 @@ if (isset($_POST['del_x'])) { } $a_nat = $a_nat_new; write_config(); - touch($d_natconfdirty_path); + mark_subsystem_dirty('natconf'); header("Location: firewall_nat.php"); exit; } @@ -148,7 +146,7 @@ echo " -

+

The NAT configuration has been changed.
You must apply the changes in order for them to take effect."); diff --git a/usr/local/www/firewall_nat_1to1.php b/usr/local/www/firewall_nat_1to1.php index 009106a..63fc39c 100755 --- a/usr/local/www/firewall_nat_1to1.php +++ b/usr/local/www/firewall_nat_1to1.php @@ -55,10 +55,8 @@ if ($_POST) { $savemsg = get_std_save_message($retval); if ($retval == 0) { - if (file_exists($d_natconfdirty_path)) - unlink($d_natconfdirty_path); - if (file_exists($d_filterconfdirty_path)) - unlink($d_filterconfdirty_path); + clear_subsystem_dirty('natconf'); + clear_subsystem_dirty('filter'); } } } @@ -67,7 +65,7 @@ if ($_GET['act'] == "del") { if ($a_1to1[$_GET['id']]) { unset($a_1to1[$_GET['id']]); write_config(); - touch($d_natconfdirty_path); + mark_subsystem_dirty('natconf'); header("Location: firewall_nat_1to1.php"); exit; } @@ -81,7 +79,7 @@ include("head.inc"); -

+

You must apply the changes in order for them to take effect.");?>
diff --git a/usr/local/www/firewall_nat_1to1_edit.php b/usr/local/www/firewall_nat_1to1_edit.php index 7ef2fab..dee8b27 100755 --- a/usr/local/www/firewall_nat_1to1_edit.php +++ b/usr/local/www/firewall_nat_1to1_edit.php @@ -128,7 +128,7 @@ if ($_POST) { else $a_1to1[] = $natent; - touch($d_natconfdirty_path); + mark_subsystem_dirty('natconf'); write_config(); diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php index b7a65e4..fc7cc9b 100755 --- a/usr/local/www/firewall_nat_edit.php +++ b/usr/local/www/firewall_nat_edit.php @@ -197,7 +197,7 @@ if ($_POST) { $a_nat[] = $natent; } - touch($d_natconfdirty_path); + mark_subsystem_dirty('natconf'); if ($_POST['autoadd']) { /* auto-generate a matching firewall rule */ @@ -224,7 +224,7 @@ if ($_POST) { $config['filter']['rule'][] = $filterent; - touch($d_filterconfdirty_path); + mark_subsystem_dirty('filter'); } write_config(); diff --git a/usr/local/www/firewall_nat_out.php b/usr/local/www/firewall_nat_out.php index 1a1192c..fc7d14b 100755 --- a/usr/local/www/firewall_nat_out.php +++ b/usr/local/www/firewall_nat_out.php @@ -59,8 +59,8 @@ if ($_POST['apply']) { $savemsg = $retval; if ($retval == 0) { - unlink_if_exists($d_natconfdirty_path); - unlink_if_exists($d_filterconfdirty_path); + clear_subsystem_dirty('natconf'); + clear_subsystem_dirty('filter'); } } @@ -112,7 +112,7 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") { break; } write_config(); - touch($d_natconfdirty_path); + mark_subsystem_dirty('natconf'); header("Location: firewall_nat_out.php"); exit; } @@ -124,7 +124,7 @@ if (isset($_POST['del_x'])) { unset($a_out[$rulei]); } write_config(); - touch($d_natconfdirty_path); + mark_subsystem_dirty('natconf'); header("Location: firewall_nat_out.php"); exit; } @@ -171,7 +171,7 @@ if (isset($_POST['del_x'])) { unset($config['nat']['advancedoutbound']); write_config(); - touch($d_natconfdirty_path); + mark_subsystem_dirty('natconf'); header("Location: firewall_nat_out.php"); exit; } @@ -188,7 +188,7 @@ include("head.inc"); -

+

You must apply the changes in order for them to take effect.");?>
diff --git a/usr/local/www/firewall_nat_out_edit.php b/usr/local/www/firewall_nat_out_edit.php index 6589fa9..596771a 100755 --- a/usr/local/www/firewall_nat_out_edit.php +++ b/usr/local/www/firewall_nat_out_edit.php @@ -234,7 +234,7 @@ if ($_POST) { $a_out[] = $natent; } - touch($d_natconfdirty_path); + mark_subsystem_dirty('natconf'); write_config(); diff --git a/usr/local/www/firewall_nat_server.php b/usr/local/www/firewall_nat_server.php index c7f07a7..876b73e 100755 --- a/usr/local/www/firewall_nat_server.php +++ b/usr/local/www/firewall_nat_server.php @@ -56,10 +56,8 @@ if ($_POST) { $savemsg = get_std_save_message($retval); if ($retval == 0) { - if (file_exists($d_natconfdirty_path)) - unlink($d_natconfdirty_path); - if (file_exists($d_filterconfdirty_path)) - unlink($d_filterconfdirty_path); + clear_subsystem_dirty('natconf'); + clear_subsystem_dirty('filter'); } } } @@ -79,7 +77,7 @@ if ($_GET['act'] == "del") { if (!$input_errors) { unset($a_snat[$_GET['id']]); write_config(); - touch($d_natconfdirty_path); + mark_subsystem_dirty('natconf'); header("Location: firewall_nat_server.php"); exit; } @@ -95,7 +93,7 @@ include("head.inc"); -

+

You must apply the changes in order for them to take effect.");?>
diff --git a/usr/local/www/firewall_nat_server_edit.php b/usr/local/www/firewall_nat_server_edit.php index 7cee424..b6aeb37 100755 --- a/usr/local/www/firewall_nat_server_edit.php +++ b/usr/local/www/firewall_nat_server_edit.php @@ -110,7 +110,7 @@ if ($_POST) { } else $a_snat[] = $natent; - touch($d_natconfdirty_path); + mark_subsystem_dirty('natconf'); write_config(); diff --git a/usr/local/www/firewall_rules.php b/usr/local/www/firewall_rules.php index d4b7312..a4da1e0 100755 --- a/usr/local/www/firewall_rules.php +++ b/usr/local/www/firewall_rules.php @@ -100,8 +100,7 @@ if ($_POST) { $retval = 0; $retval = filter_configure(); - if (file_exists($d_filterconfdirty_path)) - unlink($d_filterconfdirty_path); + clear_subsystem_dirty('filter'); $savemsg = "The settings have been applied. The firewall rules are now reloading in the background. You can also monitor the reload progress."; } @@ -111,7 +110,7 @@ if ($_GET['act'] == "del") { if ($a_filter[$_GET['id']]) { unset($a_filter[$_GET['id']]); write_config(); - touch($d_filterconfdirty_path); + mark_subsystem_dirty('filter'); header("Location: firewall_rules.php?if={$if}"); exit; } @@ -124,7 +123,7 @@ if (isset($_POST['del_x'])) { unset($a_filter[$rulei]); } write_config(); - touch($d_filterconfdirty_path); + mark_subsystem_dirty('filter'); header("Location: firewall_rules.php?if={$if}"); exit; } @@ -135,7 +134,7 @@ if (isset($_POST['del_x'])) { else $a_filter[$_GET['id']]['disabled'] = true; write_config(); - touch($d_filterconfdirty_path); + mark_subsystem_dirty('filter'); header("Location: firewall_rules.php?if={$if}"); exit; } @@ -179,7 +178,7 @@ if (isset($_POST['del_x'])) { $a_filter = $a_filter_new; write_config(); - touch($d_filterconfdirty_path); + mark_subsystem_dirty('filter'); header("Location: firewall_rules.php?if={$if}"); exit; } @@ -201,7 +200,7 @@ echo " -

+

You must apply the changes in order for them to take effect.");?>
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index 355ac1d..aa2c146 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -448,7 +448,7 @@ if ($_POST) { } write_config(); - touch($d_filterconfdirty_path); + mark_subsystem_dirty('filter'); if (isset($_POST['floating'])) header("Location: firewall_rules.php?if=FloatingRules"); diff --git a/usr/local/www/firewall_shaper.php b/usr/local/www/firewall_shaper.php index 55ec0f9..ded8724 100755 --- a/usr/local/www/firewall_shaper.php +++ b/usr/local/www/firewall_shaper.php @@ -86,7 +86,7 @@ if ($_GET) { if ($queue) { $queue->delete_queue(); write_config(); - touch($d_shaperconfdirty_path); + mark_subsystem_dirty('shaper'); } header("Location: firewall_shaper.php"); exit; @@ -170,7 +170,7 @@ if ($_GET) { $queue->SetEnabled("on"); $output_form .= $queue->build_form(); write_config(); - touch($d_shaperconfdirty_path); + mark_subsystem_dirty('shaper'); } else $input_errors[] = "Queue not found!"; break; @@ -179,7 +179,7 @@ if ($_GET) { $queue->SetEnabled(""); $output_form .= $queue->build_form(); write_config(); - touch($d_shaperconfdirty_path); + mark_subsystem_dirty('shaper'); } else $input_errors[] = "Queue not found!"; break; @@ -222,7 +222,7 @@ if ($_GET) { $altq->SetLink(&$tmppath); $altq->wconfig(); write_config(); - touch($d_shaperconfdirty_path); + mark_subsystem_dirty('shaper'); $can_enable = true; $can_add = true; } @@ -247,7 +247,7 @@ if ($_GET) { } else $can_add = false; write_config(); - touch($d_shaperconfdirty_path); + mark_subsystem_dirty('shaper'); $can_enable = true; if ($altq->GetScheduler() != "PRIQ") /* XXX */ if ($tmp->GetDefault() <> "") @@ -276,7 +276,7 @@ if ($_GET) { system("rm -f /var/db/rrd/*queues.rrd"); enable_rrd_graphing(); - unlink($d_shaperconfdirty_path); + clear_subsystem_dirty('shaper'); if ($queue) { $output_form .= $queue->build_form(); @@ -293,7 +293,7 @@ if ($_GET) { $queue->update_altq_queue_data($_POST); $queue->wconfig(); write_config(); - touch($d_shaperconfdirty_path); + mark_subsystem_dirty('shaper'); $dontshow = false; } read_altq_config(); @@ -408,7 +408,7 @@ include("fbegin.inc"); -

+

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

diff --git a/usr/local/www/firewall_shaper_layer7.php b/usr/local/www/firewall_shaper_layer7.php index 2dd5acc..773458c 100755 --- a/usr/local/www/firewall_shaper_layer7.php +++ b/usr/local/www/firewall_shaper_layer7.php @@ -141,8 +141,8 @@ else if ($_POST) { if(sizeof($dupes) == 0 && !$input_errors) { $l7r->wconfig(); write_config(); - touch($d_shaperconfdirty_path); - + mark_subsystem_dirty('shaper'); + read_layer7_config(); } else { @@ -174,8 +174,8 @@ else if ($_POST) { else $savemsg = $retval; - unlink($d_shaperconfdirty_path); - + clear_subsystem_dirty('shaper'); + if($container) { $output_form .= $container->build_form(); } else { @@ -185,7 +185,7 @@ else if ($_POST) { } else if ($_POST['delete']) { $container->delete_l7c(); write_config(); - touch($d_shaperconfdirty_path); + mark_subsystem_dirty('shaper'); unset($container); header("Location: firewall_shaper_layer7.php"); @@ -386,7 +386,7 @@ include("fbegin.inc"); -

+

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

diff --git a/usr/local/www/firewall_shaper_queues.php b/usr/local/www/firewall_shaper_queues.php index 3495fdf..dc62a29 100755 --- a/usr/local/www/firewall_shaper_queues.php +++ b/usr/local/www/firewall_shaper_queues.php @@ -75,7 +75,7 @@ if ($_GET) { if ($qtmp) { $qtmp->delete_queue(); write_config(); - touch($d_shaperconfdirty_path); + mark_subsystem_dirty('shaper'); } header("Location: firewall_shaper_queues.php"); exit; @@ -113,7 +113,7 @@ if ($_GET) { $config['shaper']['queue'][] = $newroot; } write_config(); - touch($d_shaperconfdirty_path); + mark_subsystem_dirty('shaper'); break; } } @@ -159,7 +159,7 @@ if ($_POST['apply']) { system("rm -f /var/db/rrd/*queues.rrd"); enable_rrd_graphing(); - unlink($d_shaperconfdirty_path); + clear_subsystem_dirty('shaper'); } $pgtitle = "Firewall: Shaper: By Queues View"; @@ -175,7 +175,7 @@ include("head.inc"); -

+

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

diff --git a/usr/local/www/firewall_shaper_vinterface.php b/usr/local/www/firewall_shaper_vinterface.php index 7415447..e1370d8 100644 --- a/usr/local/www/firewall_shaper_vinterface.php +++ b/usr/local/www/firewall_shaper_vinterface.php @@ -1,7 +1,7 @@ delete_queue(); write_config(); - touch($d_shaperconfdirty_path); + mark_subsystem_dirty('shaper'); } header("Location: firewall_shaper_vinterface.php"); exit; @@ -152,7 +152,7 @@ if ($_GET) { $queue->SetEnabled("on"); $output_form .= $queue->build_form(); write_config(); - touch($d_shaperconfdirty_path); + mark_subsystem_dirty('shaper'); } else $input_errors[] = "Queue not found!"; break; @@ -161,7 +161,7 @@ if ($_GET) { $queue->SetEnabled(""); $output_form .= $queue->build_form(); write_config(); - touch($d_shaperconfdirty_path); + mark_subsystem_dirty('shaper'); } else $input_errors[] = "Queue not found!"; break; @@ -184,7 +184,7 @@ if ($_GET) { $dnpipe->SetLink(&$tmppath); $dnpipe->wconfig(); write_config(); - touch($d_shaperconfdirty_path); + mark_subsystem_dirty('shaper'); $can_enable = true; $can_add = true; } @@ -202,7 +202,7 @@ if ($_GET) { write_config(); $can_enable = true; $can_add = false; - touch($d_shaperconfdirty_path); + mark_subsystem_dirty('shaper'); $can_enable = true; } read_dummynet_config(); @@ -224,7 +224,7 @@ if ($_GET) { /* XXX: TODO Make dummynet pretty graphs */ // enable_rrd_graphing(); - unlink($d_shaperconfdirty_path); + clear_subsystem_dirty('shaper'); if ($queue) { $output_form .= $queue->build_form(); @@ -241,7 +241,7 @@ if ($_GET) { $queue->update_dn_data($_POST); $queue->wconfig(); write_config(); - touch($d_shaperconfdirty_path); + mark_subsystem_dirty('shaper'); $dontshow = false; } read_dummynet_config(); @@ -351,7 +351,7 @@ include("fbegin.inc"); -

+

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

diff --git a/usr/local/www/firewall_shaper_wizards.php b/usr/local/www/firewall_shaper_wizards.php index fb8e9af..e1a5532 100755 --- a/usr/local/www/firewall_shaper_wizards.php +++ b/usr/local/www/firewall_shaper_wizards.php @@ -1,7 +1,7 @@ -

+

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

diff --git a/usr/local/www/firewall_virtual_ip.php b/usr/local/www/firewall_virtual_ip.php index d24f234..2f51a7d 100755 --- a/usr/local/www/firewall_virtual_ip.php +++ b/usr/local/www/firewall_virtual_ip.php @@ -67,7 +67,7 @@ if ($_POST) { interfaces_carp_configure(); $savemsg = get_std_save_message($retval); - unlink_if_exists($d_vipconfdirty_path); + clear_subsystem_dirty('vip'); } } @@ -90,7 +90,7 @@ if ($_GET['act'] == "del") { mwexec("/sbin/ifconfig " . get_real_interface($a_vip[$_GET['id']]['interface']) . " delete {$a_vip[$_GET['id']]['subnet']}"); unset($a_vip[$_GET['id']]); write_config(); - touch($d_vipconfdirty_path); + mark_subsystem_dirty('vip'); header("Location: firewall_virtual_ip.php"); exit; } @@ -111,7 +111,7 @@ include("head.inc"); if ($savemsg) print_info_box($savemsg); else - if (file_exists($d_vipconfdirty_path)) + if (is_subsystem_dirty('vip')) print_info_box_np("The VIP configuration has been changed.
You must apply the changes in order for them to take effect."); ?>
diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php index 2aca9be..1b83863 100755 --- a/usr/local/www/firewall_virtual_ip_edit.php +++ b/usr/local/www/firewall_virtual_ip_edit.php @@ -205,7 +205,7 @@ if ($_POST) { } else $a_vip[] = $vipent; - touch($d_vipconfdirty_path); + mark_subsystem_dirty('vip'); write_config(); diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index b094f7d..0ccec83 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -44,7 +44,6 @@ if (!$omit_nocacheheaders) { } /* parse the configuration and include all configuration functions */ -require_once("config.inc"); require_once("functions.inc"); /* Pull in all the gui related display classes) */ @@ -71,34 +70,6 @@ foreach($apple_ua as $useragent) if(strstr($_SERVER['HTTP_USER_AGENT'], $useragent)) $g['theme'] = "pfsense"; -$d_landirty_path = $g['varrun_path'] . "/lan.conf.dirty"; -$d_pppoeuserdirty_path = $g['varrun_path'] . "/vpn-pppoe-users-edit.dirty"; -$d_hostsdirty_path = $g['varrun_path'] . "/hosts.dirty"; -$d_natconfdirty_path = $g['varrun_path'] . "/nat.conf.dirty"; -$d_filterconfdirty_path = $g['varrun_path'] . "/filter.conf.dirty"; -$d_ipsecconfdirty_path = $g['varrun_path'] . "/ipsec.conf.dirty"; -$d_shaperconfdirty_path = $g['varrun_path'] . "/shaper.conf.dirty"; -$d_pptpuserdirty_path = $g['varrun_path'] . "/pptpd.user.dirty"; -$d_dnsmasqdirty_path = $g['varrun_path'] . "/dnsmasq.dirty"; -$d_staticmapsdirty_path = $g['varrun_path'] . "/staticmaps.dirty"; -$d_staticroutesdirty_path = $g['varrun_path'] . "/staticroutes.dirty"; -$d_aliasesdirty_path = $g['varrun_path'] . "/aliases.dirty"; -$d_proxyarpdirty_path = $g['varrun_path'] . "/proxyarp.dirty"; -$d_fwupenabled_path = $g['varrun_path'] . "/fwup.enabled"; -$d_firmwarelock_path = $g['varrun_path'] . "/firmware.lock"; -$d_sysrebootreqd_path = $g['varrun_path'] . "/sysreboot.reqd"; -$d_passthrumacsdirty_path = $g['varrun_path'] . "/passthrumacs.dirty"; -$d_allowedipsdirty_path = $g['varrun_path'] . "/allowedips.dirty"; -$d_ovpnclidirty_path = $g['varrun_path'] . "/ovpnclient.dirty"; -$d_vipconfdirty_path = $g['varrun_path'] . "/vip.conf.dirty"; -$d_sysctldirty_path = $g['varrun_path'] . "/sysctl.conf.dirty"; -$d_vsconfdirty_path = $g['varrun_path'] . "/vs.conf.dirty"; -$d_shaperconfdirty_path = $g['varrun_path'] . "/shaper.conf.dirty"; - -/* OpenVPN Directories */ -$d_ovpnsrvdirty_path = "/tmp/ovpn-srv.dirty"; -$d_ovpncrldirty_path = "/tmp/ovpn-crl.dirty"; -$d_ovpnclidirty_path = "/tmp/ovpn-cli.dirty"; /* used by progress bar */ $lastseen = "-1"; @@ -106,7 +77,7 @@ $navlevelsep = ": "; /* navigation level separator string */ $mandfldhtml = ""; /* display this before mandatory input fields */ $mandfldhtmlspc = ""; /* same as above, but with spacing */ -if (file_exists($d_firmwarelock_path)) { +if (is_subsystem_dirty('firmwarelock')) { if (!$d_isfwfile) { header("Location: system_firmware.php"); exit; @@ -1417,4 +1388,4 @@ function download_file_with_progress_bar($url_file, $destination_file, $readbody return ($http_code == 200) ? true : $http_code; } -?> \ No newline at end of file +?> diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 90cf167..72b2bd6 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -229,11 +229,11 @@ if (isset($wancfg['wireless'])) { if ($_POST['apply']) { unset($input_errors); - if (!file_exists($d_landirty_path)) + if (!is_subsystem_dirty('interfaces')) $intput_errors[] = "You have already applied your settings!"; else { unlink_if_exists("{$g['tmp_path']}/config.cache"); - unlink_if_exists("{$d_landirty_path}"); + clear_subsystem_dirty('interfaces'); interface_configure($if); reset_carp(); /* restart snmp so that it binds to correct address */ @@ -244,8 +244,7 @@ if ($_POST['apply']) { /* sync filter configuration */ setup_gateways_monitor(); - if (file_exists($d_staticroutesdirty_path)) - unlink($d_staticroutesdirty_path); + clear_subsystem_dirty('staticroutes'); } header("Location: interfaces.php?if={$if}"); exit; @@ -255,7 +254,7 @@ if ($_POST && $_POST['enable'] == "no") { unset($wancfg['enable']); interface_bring_down($if); write_config("Interface {$_POST['descr']}({$if}) is now disabled."); - touch($d_landirty_path); + mark_subsystem_dirty('interfaces'); header("Location: interfaces.php?if={$if}"); exit; } else @@ -475,7 +474,7 @@ if ($_POST) { if (isset($wancfg['wireless'])) handle_wireless_post(); write_config(); - touch($d_landirty_path); + mark_subsystem_dirty('interfaces'); /* regenerate cron settings/crontab file */ configure_cron(); conf_mount_ro(); @@ -726,7 +725,7 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe" -

+

You must apply the changes in order for them to take effect.

Don't forget to adjust the DHCP Server range if needed before applying."));?>
diff --git a/usr/local/www/load_balancer_monitor.php b/usr/local/www/load_balancer_monitor.php index 96406a9..c133d0f 100755 --- a/usr/local/www/load_balancer_monitor.php +++ b/usr/local/www/load_balancer_monitor.php @@ -52,7 +52,7 @@ if ($_POST) { $retval |= relayd_configure(); $savemsg = get_std_save_message($retval); - unlink_if_exists($d_vsconfdirty_path); + clear_subsystem_dirty('loadbalancer'); } } @@ -71,7 +71,7 @@ if ($_GET['act'] == "del") { if (!$input_errors) { unset($a_monitor[$_GET['id']]); write_config(); - touch($d_vsconfdirty_path); + mark_subsystem_dirty('loadbalancer'); header("Location: load_balancer_monitor.php"); exit; } @@ -87,7 +87,7 @@ include("head.inc"); -

+

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

diff --git a/usr/local/www/load_balancer_monitor_edit.php b/usr/local/www/load_balancer_monitor_edit.php index 82ef06d..c4eda7f 100755 --- a/usr/local/www/load_balancer_monitor_edit.php +++ b/usr/local/www/load_balancer_monitor_edit.php @@ -175,7 +175,7 @@ if ($_POST) { if ($changecount > 0) { /* Mark config dirty */ conf_mount_rw(); - touch($d_vsconfdirty_path); + mark_subsystem_dirty('loadbalancer'); write_config($changedesc); } diff --git a/usr/local/www/load_balancer_pool.php b/usr/local/www/load_balancer_pool.php index 80b6941..2890bd8 100755 --- a/usr/local/www/load_balancer_pool.php +++ b/usr/local/www/load_balancer_pool.php @@ -54,7 +54,7 @@ if ($_POST) { $retval |= relayd_configure(); $savemsg = get_std_save_message($retval); - unlink_if_exists($d_vsconfdirty_path); + clear_subsystem_dirty('loadbalancer'); } } @@ -73,7 +73,7 @@ if ($_GET['act'] == "del") { if (!$input_errors) { unset($a_pool[$_GET['id']]); write_config(); - touch($d_vsconfdirty_path); + mark_subsystem_dirty('loadbalancer'); header("Location: load_balancer_pool.php"); exit; } @@ -98,7 +98,7 @@ include("head.inc"); -

+

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

diff --git a/usr/local/www/load_balancer_pool_edit.php b/usr/local/www/load_balancer_pool_edit.php index 4bf71f8..382d4c5 100755 --- a/usr/local/www/load_balancer_pool_edit.php +++ b/usr/local/www/load_balancer_pool_edit.php @@ -126,7 +126,7 @@ if ($_POST) { if ($changecount > 0) { /* Mark pool dirty */ conf_mount_rw(); - touch($d_vsconfdirty_path); + mark_subsystem_dirty('loadbalancer'); write_config($changedesc); } diff --git a/usr/local/www/load_balancer_relay_action.php b/usr/local/www/load_balancer_relay_action.php index 6653f93..cd25365 100755 --- a/usr/local/www/load_balancer_relay_action.php +++ b/usr/local/www/load_balancer_relay_action.php @@ -54,7 +54,7 @@ if ($_POST) { $retval |= relayd_configure(); $savemsg = get_std_save_message($retval); - unlink_if_exists($d_vsconfdirty_path); + clear_subsystem_dirty('loadbalancer'); } } @@ -75,7 +75,7 @@ if ($_GET['act'] == "del") { if (!$input_errors) { unset($a_action[$_GET['id']]); write_config(); - touch($d_vsconfdirty_path); + mark_subsystem_dirty('loadbalancer'); header("Location: load_balancer_relay_action.php"); exit; } @@ -104,7 +104,7 @@ include("head.inc"); -

+

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

diff --git a/usr/local/www/load_balancer_relay_action_edit.php b/usr/local/www/load_balancer_relay_action_edit.php index 36c640c..d51c61b 100755 --- a/usr/local/www/load_balancer_relay_action_edit.php +++ b/usr/local/www/load_balancer_relay_action_edit.php @@ -164,7 +164,7 @@ if ($_POST) { if ($changecount > 0) { /* Mark config dirty */ conf_mount_rw(); - touch($d_vsconfdirty_path); + mark_subsystem_dirty('loadbalancer'); write_config($changedesc); } diff --git a/usr/local/www/load_balancer_relay_protocol.php b/usr/local/www/load_balancer_relay_protocol.php index e0007b5..2207542 100755 --- a/usr/local/www/load_balancer_relay_protocol.php +++ b/usr/local/www/load_balancer_relay_protocol.php @@ -52,7 +52,7 @@ if ($_POST) { $retval |= relayd_configure(); $savemsg = get_std_save_message($retval); - unlink_if_exists($d_vsconfdirty_path); + clear_subsystem_dirty('loadbalancer'); } } @@ -71,7 +71,7 @@ if ($_GET['act'] == "del") { if (!$input_errors) { unset($a_protocol[$_GET['id']]); write_config(); - touch($d_vsconfdirty_path); + mark_subsystem_dirty('loadbalancer'); header("Location: load_balancer_relay_protocol.php"); exit; } @@ -100,7 +100,7 @@ include("head.inc"); -

+

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

diff --git a/usr/local/www/load_balancer_relay_protocol_edit.php b/usr/local/www/load_balancer_relay_protocol_edit.php index dcdb9b9..17832f7 100755 --- a/usr/local/www/load_balancer_relay_protocol_edit.php +++ b/usr/local/www/load_balancer_relay_protocol_edit.php @@ -119,7 +119,7 @@ if ($_POST) { if ($changecount > 0) { /* Mark config dirty */ conf_mount_rw(); - touch($d_vsconfdirty_path); + mark_subsystem_dirty('loadbalancer'); write_config($changedesc); } diff --git a/usr/local/www/load_balancer_virtual_server.php b/usr/local/www/load_balancer_virtual_server.php index ba62613..f087c90 100755 --- a/usr/local/www/load_balancer_virtual_server.php +++ b/usr/local/www/load_balancer_virtual_server.php @@ -53,7 +53,7 @@ if ($_POST) { $retval |= filter_configure(); $retval |= relayd_configure(); $savemsg = get_std_save_message($retval); - unlink_if_exists($d_vsconfdirty_path); + clear_subsystem_dirty('loadbalancer'); } } @@ -63,7 +63,7 @@ if ($_GET['act'] == "del") { if (!$input_errors) { unset($a_vs[$_GET['id']]); write_config(); - touch($d_vsconfdirty_path); + mark_subsystem_dirty('loadbalancer'); header("Location: load_balancer_virtual_server.php"); exit; } @@ -94,7 +94,7 @@ include("head.inc"); -

+

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

diff --git a/usr/local/www/load_balancer_virtual_server_edit.php b/usr/local/www/load_balancer_virtual_server_edit.php index d62b765..8523286 100755 --- a/usr/local/www/load_balancer_virtual_server_edit.php +++ b/usr/local/www/load_balancer_virtual_server_edit.php @@ -114,7 +114,7 @@ if ($_POST) { if ($changecount > 0) { /* Mark virtual server dirty */ - touch($d_vsconfdirty_path); + mark_subsystem_dirty('loadbalancer'); write_config($changedesc); } diff --git a/usr/local/www/services_captiveportal_ip.php b/usr/local/www/services_captiveportal_ip.php index ed828ac..1296909 100755 --- a/usr/local/www/services_captiveportal_ip.php +++ b/usr/local/www/services_captiveportal_ip.php @@ -55,11 +55,8 @@ if ($_POST) { $retval = captiveportal_allowedip_configure(); $savemsg = get_std_save_message($retval); - if ($retval == 0) { - if (file_exists($d_allowedipsdirty_path)) { - unlink($d_allowedipsdirty_path); - } - } + if ($retval == 0) + clear_subsystem_dirty('allowedips'); } } @@ -67,7 +64,7 @@ if ($_GET['act'] == "del") { if ($a_allowedips[$_GET['id']]) { unset($a_allowedips[$_GET['id']]); write_config(); - touch($d_allowedipsdirty_path); + mark_subsystem_dirty('allowedips'); header("Location: services_captiveportal_ip.php"); exit; } @@ -80,7 +77,7 @@ include("head.inc"); - +You must apply the changes in order for them to take effect.");?>
diff --git a/usr/local/www/services_captiveportal_ip_edit.php b/usr/local/www/services_captiveportal_ip_edit.php index bc0f29e..9efc033 100755 --- a/usr/local/www/services_captiveportal_ip_edit.php +++ b/usr/local/www/services_captiveportal_ip_edit.php @@ -93,7 +93,7 @@ if ($_POST) { write_config(); - touch($d_allowedipsdirty_path) ; + mark_subsystem_dirty('allowedips'); header("Location: services_captiveportal_ip.php"); exit; diff --git a/usr/local/www/services_captiveportal_mac.php b/usr/local/www/services_captiveportal_mac.php index 1b779f5..0579749 100755 --- a/usr/local/www/services_captiveportal_mac.php +++ b/usr/local/www/services_captiveportal_mac.php @@ -55,11 +55,8 @@ if ($_POST) { $retval = captiveportal_passthrumac_configure(); $savemsg = get_std_save_message($retval); - if ($retval == 0) { - if (file_exists($d_passthrumacsdirty_path)) { - unlink($d_passthrumacsdirty_path); - } - } + if ($retval == 0) + clear_subsystem_dirty('passthrumac'); } } @@ -67,7 +64,7 @@ if ($_GET['act'] == "del") { if ($a_passthrumacs[$_GET['id']]) { unset($a_passthrumacs[$_GET['id']]); write_config(); - touch($d_passthrumacsdirty_path); + mark_subsystem_dirty('passthrumac'); header("Location: services_captiveportal_mac.php"); exit; } @@ -80,7 +77,7 @@ include("head.inc"); -

+

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

diff --git a/usr/local/www/services_captiveportal_mac_edit.php b/usr/local/www/services_captiveportal_mac_edit.php index 7161a20..0b6b329 100755 --- a/usr/local/www/services_captiveportal_mac_edit.php +++ b/usr/local/www/services_captiveportal_mac_edit.php @@ -93,7 +93,7 @@ if ($_POST) { write_config(); - touch($d_passthrumacsdirty_path) ; + mark_subsystem_dirty('passthrumac'); header("Location: services_captiveportal_mac.php"); exit; diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index 7c94947..7856828 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -312,17 +312,13 @@ if ($_POST) { if (isset($config['dnsmasq']['regdhcpstatic'])) { $retvaldns = services_dnsmasq_configure(); if ($retvaldns == 0) { - if (file_exists($d_hostsdirty_path)) - unlink($d_hostsdirty_path); - if (file_exists($d_staticmapsdirty_path)) - unlink($d_staticmapsdirty_path); + clear_subsystem_dirty('hosts'); + clear_subsystem_dirty('staticmaps'); } } else { $retvaldhcp = services_dhcpd_configure(); - if ($retvaldhcp == 0) { - if (file_exists($d_staticmapsdirty_path)) - unlink($d_staticmapsdirty_path); - } + if ($retvaldhcp == 0) + clear_subsystem_dirty('staticmaps'); } if($retvaldhcp == 1 || $retvaldns == 1) $retval = 1; @@ -335,9 +331,9 @@ if ($_GET['act'] == "del") { unset($a_maps[$_GET['id']]); write_config(); if(isset($config['dhcpd'][$if]['enable'])) { - touch($d_staticmapsdirty_path); + mark_subsystem_dirty('staticmaps'); if (isset($config['dnsmasq']['regdhcpstatic'])) - touch($d_hostsdirty_path); + mark_subsystem_dirty('hosts'); } header("Location: services_dhcp.php?if={$if}"); exit; @@ -426,7 +422,7 @@ function show_netboot_config() { exit; } ?> -

+

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

diff --git a/usr/local/www/services_dhcp_edit.php b/usr/local/www/services_dhcp_edit.php index 3239d05..b5718fa 100755 --- a/usr/local/www/services_dhcp_edit.php +++ b/usr/local/www/services_dhcp_edit.php @@ -146,9 +146,9 @@ if ($_POST) { write_config(); if(isset($config['dhcpd'][$if]['enable'])) { - touch($d_staticmapsdirty_path); + mark_subsystem_dirty('staticmaps'); if (isset($config['dnsmasq']['regdhcpstatic'])) - touch($d_hostsdirty_path); + mark_subsystem_dirty('hosts'); } header("Location: services_dhcp.php?if={$if}"); diff --git a/usr/local/www/services_dnsmasq.php b/usr/local/www/services_dnsmasq.php index 3f6e27b..42482ac 100755 --- a/usr/local/www/services_dnsmasq.php +++ b/usr/local/www/services_dnsmasq.php @@ -68,10 +68,8 @@ if ($_POST) { $retval = services_dnsmasq_configure(); $savemsg = get_std_save_message($retval); - if ($retval == 0) { - if (file_exists($d_hostsdirty_path)) - unlink($d_hostsdirty_path); - } + if ($retval == 0) + clear_subsystem_dirty('hosts'); } if ($_GET['act'] == "del") { @@ -79,7 +77,7 @@ if ($_GET['act'] == "del") { if ($a_hosts[$_GET['id']]) { unset($a_hosts[$_GET['id']]); write_config(); - touch($d_hostsdirty_path); + mark_subsystem_dirty('hosts'); header("Location: services_dnsmasq.php"); exit; } @@ -88,7 +86,7 @@ if ($_GET['act'] == "del") { if ($a_domainOverrides[$_GET['id']]) { unset($a_domainOverrides[$_GET['id']]); write_config(); - touch($d_hostsdirty_path); + mark_subsystem_dirty('hosts'); header("Location: services_dnsmasq.php"); exit; } @@ -115,7 +113,7 @@ function enable_change(enable_over) { -

+

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

diff --git a/usr/local/www/services_dnsmasq_domainoverride_edit.php b/usr/local/www/services_dnsmasq_domainoverride_edit.php index 0491050..f816546 100755 --- a/usr/local/www/services_dnsmasq_domainoverride_edit.php +++ b/usr/local/www/services_dnsmasq_domainoverride_edit.php @@ -82,7 +82,7 @@ if ($_POST) { else $a_domainOverrides[] = $doment; - touch($d_dnsmasqdirty_path); + mark_subsystem_dirty('dnsmasq'); write_config(); diff --git a/usr/local/www/services_dnsmasq_edit.php b/usr/local/www/services_dnsmasq_edit.php index f14cf9d..93d2a06 100755 --- a/usr/local/www/services_dnsmasq_edit.php +++ b/usr/local/www/services_dnsmasq_edit.php @@ -99,7 +99,7 @@ if ($_POST) { else $a_hosts[] = $hostent; - touch($d_hostsdirty_path); + mark_subsystem_dirty('hosts'); write_config(); diff --git a/usr/local/www/services_proxyarp.php b/usr/local/www/services_proxyarp.php index 51a29a0..c93d51d 100755 --- a/usr/local/www/services_proxyarp.php +++ b/usr/local/www/services_proxyarp.php @@ -54,17 +54,15 @@ if ($_POST) { $retval = services_proxyarp_configure(); $savemsg = get_std_save_message($retval); - if ($retval == 0) { - if (file_exists($d_proxyarpdirty_path)) - unlink($d_proxyarpdirty_path); - } + if ($retval == 0) + clear_subsystem_dirty('proxyarp'); } if ($_GET['act'] == "del") { if ($a_proxyarp[$_GET['id']]) { unset($a_proxyarp[$_GET['id']]); write_config(); - touch($d_proxyarpdirty_path); + mark_subsystem_dirty('proxyarp'); header("Location: services_proxyarp.php"); exit; } @@ -79,7 +77,7 @@ include("head.inc"); -

+

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

diff --git a/usr/local/www/services_proxyarp_edit.php b/usr/local/www/services_proxyarp_edit.php index 896424a..b24f4b9 100755 --- a/usr/local/www/services_proxyarp_edit.php +++ b/usr/local/www/services_proxyarp_edit.php @@ -130,7 +130,7 @@ if ($_POST) { else $a_proxyarp[] = $arpent; - touch($d_proxyarpdirty_path); + mark_subsystem_dirty('proxyarp'); write_config(); diff --git a/usr/local/www/system_advanced_sysctl.php b/usr/local/www/system_advanced_sysctl.php index 763fab8..53b26e6 100644 --- a/usr/local/www/system_advanced_sysctl.php +++ b/usr/local/www/system_advanced_sysctl.php @@ -74,7 +74,7 @@ if ($act == "del") { if (!$input_errors) { unset($a_tunable[$id]); write_config(); - touch($d_sysctldirty_path); + mark_subsystem_dirty('sysctl'); pfSenseHeader("firewall_system_tunables.php"); exit; } @@ -96,7 +96,7 @@ if ($_POST) { $retval = 0; system_setup_sysctl(); $savemsg = get_std_save_message($retval); - unlink_if_exists($d_sysctldirty_path); + clear_subsystem_dirty('sysctl'); } if ($_POST['Submit'] == "Save") { @@ -111,7 +111,7 @@ if ($_POST) { else $a_tunable[] = $tunableent; - touch($d_sysctldirty_path); + mark_subsystem_dirty('sysctl'); write_config(); @@ -135,7 +135,7 @@ include("head.inc"); print_input_errors($input_errors); if ($savemsg) print_info_box($savemsg); - if (file_exists($d_sysctldirty_path) && ($act != "edit" )) + if (is_subsystem_dirty('sysctl') && ($act != "edit" )) print_info_box_np("The firewall tunables have changed. You must apply the configuration to take affect."); ?> diff --git a/usr/local/www/system_firmware.php b/usr/local/www/system_firmware.php index 45dd6fc..b133334 100755 --- a/usr/local/www/system_firmware.php +++ b/usr/local/www/system_firmware.php @@ -50,7 +50,7 @@ ini_set('max_execution_time', '9999'); ini_set('max_input_time', '9999'); /* if upgrade in progress, alert user */ -if(file_exists($d_firmwarelock_path)) { +if(is_subsystem_dirty('firmwarelock')) { $pgtitle = array("System","Firmware","Manual Update"); include("head.inc"); echo "\n"; @@ -72,7 +72,7 @@ if($_POST['kerneltype']) { } /* Handle manual upgrade */ -if ($_POST && !file_exists($d_firmwarelock_path)) { +if ($_POST && !is_subsystem_dirty('firmwarelock')) { unset($input_errors); unset($sig_warning); @@ -91,12 +91,11 @@ if ($_POST && !file_exists($d_firmwarelock_path)) { if ($mode == "enable") { exec_rc_script("/etc/rc.firmware enable"); conf_mount_rw(); - touch($d_fwupenabled_path); + mark_subsystem_dirty('firmware'); } else if ($mode == "disable") { exec_rc_script("/etc/rc.firmware disable"); conf_mount_ro(); - if (file_exists($d_fwupenabled_path)) - unlink($d_fwupenabled_path); + clear_subsystem_dirty('firmware'); } else if ($mode == "upgrade") { if (is_uploaded_file($_FILES['ulfile']['tmp_name'])) { /* verify firmware image(s) */ @@ -106,8 +105,7 @@ if ($_POST && !file_exists($d_firmwarelock_path)) { /* probably out of memory for the MFS */ $input_errors[] = "Image upload failed (out of memory?)"; exec_rc_script("/etc/rc.firmware disable"); - if (file_exists($d_fwupenabled_path)) - unlink($d_fwupenabled_path); + clear_subsystem_dirty('firmware'); } else { /* move the image so PHP won't delete it */ rename($_FILES['ulfile']['tmp_name'], "{$g['upload_path']}/firmware.tgz"); @@ -132,10 +130,10 @@ if ($_POST && !file_exists($d_firmwarelock_path)) { run_plugins("/usr/local/pkg/firmware_upgrade"); /* Check for input errors, firmware locks, warnings, then check for firmware if sig_override is set */ - if (!$input_errors && !file_exists($d_firmwarelock_path) && (!$sig_warning || $_POST['sig_override'])) { + if (!$input_errors && !is_subsystem_dirty('firmwarelock') && (!$sig_warning || $_POST['sig_override'])) { if (file_exists("{$g['upload_path']}/firmware.tgz")) { /* fire up the update script in the background */ - touch($d_firmwarelock_path); + mark_subsystem_dirty('firmwarelock'); $savemsg = "The firmware is now being updated. The firewall will reboot automatically."; if(stristr($_FILES['ulfile']['name'],"nanobsd")) mwexec_bg("/etc/rc.firmware pfSenseNanoBSDupgrade {$g['upload_path']}/firmware.tgz"); @@ -178,7 +176,7 @@ print_info_box($sig_warning); - +
@@ -209,8 +207,8 @@ print_info_box($sig_warning); Click "Upgrade firmware" to start the upgrade process.

- - + + diff --git a/usr/local/www/system_gateway_groups.php b/usr/local/www/system_gateway_groups.php index 3d794a7..295fa26 100755 --- a/usr/local/www/system_gateway_groups.php +++ b/usr/local/www/system_gateway_groups.php @@ -58,11 +58,8 @@ if ($_POST) { $retval |= filter_configure(); $savemsg = get_std_save_message($retval); - if ($retval == 0) { - if (file_exists($d_staticroutesdirty_path)) { - unlink($d_staticroutesdirty_path); - } - } + if ($retval == 0) + clear_subsystem_dirty('staticroutes'); } } @@ -71,7 +68,7 @@ if ($_GET['act'] == "del") { $changedesc .= "removed gateway group {$_GET['id']}"; unset($a_gateway_groups[$_GET['id']]); write_config($changedesc); - touch($d_staticroutesdirty_path); + mark_subsystem_dirty('staticroutes'); header("Location: system_gateway_groups.php"); exit; } @@ -87,7 +84,7 @@ include("head.inc");
-

+

You must apply the changes in order for them to take effect.");?>
diff --git a/usr/local/www/system_gateway_groups_edit.php b/usr/local/www/system_gateway_groups_edit.php index 1bbdeaa..1fdcdf2 100755 --- a/usr/local/www/system_gateway_groups_edit.php +++ b/usr/local/www/system_gateway_groups_edit.php @@ -126,7 +126,7 @@ if ($_POST) { else $a_gateway_groups[] = $gateway_group; - touch($d_staticroutesdirty_path); + mark_subsystem_dirty('staticroutes'); write_config(); diff --git a/usr/local/www/system_gateways.php b/usr/local/www/system_gateways.php index 6522895..c06130f 100755 --- a/usr/local/www/system_gateways.php +++ b/usr/local/www/system_gateways.php @@ -62,11 +62,8 @@ if ($_POST) { setup_gateways_monitor(); $savemsg = get_std_save_message($retval); - if ($retval == 0) { - if (file_exists($d_staticroutesdirty_path)) { - unlink($d_staticroutesdirty_path); - } - } + if ($retval == 0) + clear_subsystem_dirty('staticroutes'); } } @@ -79,7 +76,7 @@ if ($_GET['act'] == "del") { $changedesc .= "removed gateway {$realid}"; unset($a_gateways[$realid]); write_config($changedesc); - touch($d_staticroutesdirty_path); + mark_subsystem_dirty('staticroutes'); header("Location: system_gateways.php"); exit; } @@ -96,7 +93,7 @@ include("head.inc"); -

+

You must apply the changes in order for them to take effect.");?>
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index 00dcbe0..5e83145 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -156,7 +156,7 @@ if ($_POST) { } } - touch($d_staticroutesdirty_path); + mark_subsystem_dirty('staticroutes'); write_config(); diff --git a/usr/local/www/system_routes.php b/usr/local/www/system_routes.php index c563d5e..cea51b9 100755 --- a/usr/local/www/system_routes.php +++ b/usr/local/www/system_routes.php @@ -64,11 +64,8 @@ if ($_POST) { setup_gateways_monitor(); $savemsg = get_std_save_message($retval); - if ($retval == 0) { - if (file_exists($d_staticroutesdirty_path)) { - unlink($d_staticroutesdirty_path); - } - } + if ($retval == 0) + clear_subsystem_dirty('staticroutes'); } else { if ($_POST['enablefastrouting'] == "") { /* Only update config if something changed */ @@ -93,7 +90,7 @@ if ($_GET['act'] == "del") { $changedesc .= "removed route to " . $a_routes[$_GET['id']['route']]; unset($a_routes[$_GET['id']]); write_config($changedesc); - touch($d_staticroutesdirty_path); + mark_subsystem_dirty('staticroutes'); header("Location: system_routes.php"); exit; } @@ -109,7 +106,7 @@ include("head.inc"); -

+

You must apply the changes in order for them to take effect.");?>
diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php index bdd2343..28c9edd 100755 --- a/usr/local/www/system_routes_edit.php +++ b/usr/local/www/system_routes_edit.php @@ -117,7 +117,7 @@ if ($_POST) { else $a_routes[] = $route; - touch($d_staticroutesdirty_path); + mark_subsystem_dirty('staticroutes'); write_config(); diff --git a/usr/local/www/vpn_ipsec.php b/usr/local/www/vpn_ipsec.php index 870f048..a86b4f6 100755 --- a/usr/local/www/vpn_ipsec.php +++ b/usr/local/www/vpn_ipsec.php @@ -62,8 +62,8 @@ if ($_POST) { filter_configure(); $savemsg = get_std_save_message($retval); if ($retval == 0) { - if (file_exists($d_ipsecconfdirty_path)) - unlink($d_ipsecconfdirty_path); + if (is_subsystem_dirty('ipsec')) + clear_subsystem_dirty('ipsec'); } } else if ($_POST['submit']) { $pconfig = $_POST; @@ -124,7 +124,7 @@ include("head.inc"); You must apply the changes in order for them to take effect."); ?> diff --git a/usr/local/www/vpn_ipsec_mobile.php b/usr/local/www/vpn_ipsec_mobile.php index 47ac3a3..88815bf 100755 --- a/usr/local/www/vpn_ipsec_mobile.php +++ b/usr/local/www/vpn_ipsec_mobile.php @@ -103,8 +103,8 @@ if ($_POST['apply']) { $retval = vpn_ipsec_configure(); $savemsg = get_std_save_message($retval); if ($retval == 0) - if (file_exists($d_ipsecconfdirty_path)) - unlink($d_ipsecconfdirty_path); + if (is_subsystem_dirty('ipsec')) + clear_subsystem_dirty('ipsec'); } if ($_POST['submit']) { @@ -201,7 +201,7 @@ if ($_POST['submit']) { $a_client = $client; write_config(); - touch($d_ipsecconfdirty_path); + mark_subsystem_dirty('ipsec'); header("Location: vpn_ipsec_mobile.php"); exit; @@ -287,7 +287,7 @@ function login_banner_change() { You must apply the changes in order for them to take effect."); foreach ($a_phase1 as $ph1ent) if (isset($ph1ent['mobile'])) diff --git a/usr/local/www/vpn_ipsec_phase1.php b/usr/local/www/vpn_ipsec_phase1.php index 36e1924..b92d18e 100644 --- a/usr/local/www/vpn_ipsec_phase1.php +++ b/usr/local/www/vpn_ipsec_phase1.php @@ -321,7 +321,7 @@ if ($_POST) { } } write_config(); - touch($d_ipsecconfdirty_path); + mark_subsystem_dirty('ipsec'); header("Location: vpn_ipsec.php"); exit; diff --git a/usr/local/www/vpn_ipsec_phase2.php b/usr/local/www/vpn_ipsec_phase2.php index 1056497..d9ab1ac 100644 --- a/usr/local/www/vpn_ipsec_phase2.php +++ b/usr/local/www/vpn_ipsec_phase2.php @@ -189,7 +189,7 @@ if ($_POST) { } write_config(); - touch($d_ipsecconfdirty_path); + mark_subsystem_dirty('ipsec'); header("Location: vpn_ipsec.php"); exit; diff --git a/usr/local/www/vpn_l2tp_users.php b/usr/local/www/vpn_l2tp_users.php index 56a2bd9..9bd96b1 100644 --- a/usr/local/www/vpn_l2tp_users.php +++ b/usr/local/www/vpn_l2tp_users.php @@ -51,7 +51,7 @@ if ($_POST) { if ($_POST['apply']) { $retval = 0; - if (!file_exists($d_sysrebootreqd_path)) { + if (!is_subsystem_dirty('rebootreq')) { $retval = vpn_l2tp_configure(); } $savemsg = get_std_save_message($retval); diff --git a/usr/local/www/vpn_pppoe_users.php b/usr/local/www/vpn_pppoe_users.php index 30de917..e0ac942 100755 --- a/usr/local/www/vpn_pppoe_users.php +++ b/usr/local/www/vpn_pppoe_users.php @@ -53,8 +53,8 @@ if ($_POST) { $retval = vpn_setup(); $savemsg = get_std_save_message($retval); if ($retval == 0) { - if (file_exists($d_pppoeuserdirty_path)) - unlink($d_pppoeuserdirty_path); + if (is_subsystem_dirty('pppoeusers')) + clear_subsystem_dirty('pppoeusers'); } } } @@ -63,7 +63,7 @@ if ($_GET['act'] == "del") { if ($a_secret[$_GET['id']]) { unset($a_secret[$_GET['id']]); write_config(); - touch($d_pppoeuserdirty_path); + mark_subsystem_dirty('pppoeusers'); header("Location: vpn_pppoe_users.php"); exit; } @@ -80,7 +80,7 @@ include("head.inc"); -

+

You must apply the changes in order for them to take effect.
Warning: this will terminate all current PPPoE sessions!");?>

diff --git a/usr/local/www/vpn_pptp_users.php b/usr/local/www/vpn_pptp_users.php index d49dd43..bc5079f 100755 --- a/usr/local/www/vpn_pptp_users.php +++ b/usr/local/www/vpn_pptp_users.php @@ -53,8 +53,8 @@ if ($_POST) { $retval = vpn_setup(); $savemsg = get_std_save_message($retval); if ($retval == 0) { - if (file_exists($d_pptpuserdirty_path)) - unlink($d_pptpuserdirty_path); + if (is_subsystem_dirty('pptpusers')) + clear_subsystem_dirty('pptpusers'); } } } @@ -63,7 +63,7 @@ if ($_GET['act'] == "del") { if ($a_secret[$_GET['id']]) { unset($a_secret[$_GET['id']]); write_config(); - touch($d_pptpuserdirty_path); + mark_subsystem_dirty('pptpusers'); header("Location: vpn_pptp_users.php"); exit; } @@ -80,7 +80,7 @@ include("head.inc"); -

+

You must apply the changes in order for them to take effect.
Warning: this will terminate all current PPTP sessions!");?>

diff --git a/usr/local/www/vpn_pptp_users_edit.php b/usr/local/www/vpn_pptp_users_edit.php index dfad162..b3299ca 100755 --- a/usr/local/www/vpn_pptp_users_edit.php +++ b/usr/local/www/vpn_pptp_users_edit.php @@ -109,7 +109,7 @@ if ($_POST) { $a_secret[] = $secretent; write_config(); - touch($d_pptpuserdirty_path); + mark_subsystem_dirty('pptpusers'); header("Location: vpn_pptp_users.php"); exit; diff --git a/usr/local/www/wizards/traffic_shaper_wizard.inc b/usr/local/www/wizards/traffic_shaper_wizard.inc index bb4559b..17e6547 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard.inc @@ -513,7 +513,7 @@ function step5_stepsubmitphpaction() { } function step8_stepsubmitphpaction() { - global $g, $config, $d_shaperconfdirty_path; + global $g, $config; /* save the new configuration */ apply_all_choosen_items(); @@ -527,7 +527,7 @@ function step8_stepsubmitphpaction() { filter_configure(); /* And we're no longer dirty! */ - unlink_if_exists($d_shaperconfdirty_path); + clear_subsystem_dirty('shaper'); update_filter_reload_status("Initializing"); diff --git a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc index 3d05c7f..650e878 100755 --- a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc @@ -549,7 +549,7 @@ function step5_stepsubmitphpaction() { } function step8_stepsubmitphpaction() { - global $g, $config, $d_shaperconfdirty_path; + global $g, $config; /* save the new configuration */ apply_all_choosen_items(); @@ -563,7 +563,7 @@ function step8_stepsubmitphpaction() { filter_configure(); /* And we're no longer dirty! */ - unlink_if_exists($d_shaperconfdirty_path); + clear_subsystem_dirty('shaper'); update_filter_reload_status("Initializing"); diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc index 1173a1e..dd6caa5 100755 --- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc @@ -594,7 +594,7 @@ function step5_stepsubmitphpaction() { } function step8_stepsubmitphpaction() { - global $g, $config, $d_shaperconfdirty_path; + global $g, $config; /* save the new configuration */ apply_all_choosen_items(); @@ -608,7 +608,7 @@ function step8_stepsubmitphpaction() { filter_configure(); /* And we're no longer dirty! */ - unlink_if_exists($d_shaperconfdirty_path); + clear_subsystem_dirty('shaper'); update_filter_reload_status("Initializing"); diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc index 1de1269..a876839 100644 --- a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc +++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc @@ -377,7 +377,7 @@ function step5_stepsubmitphpaction() { } function step8_stepsubmitphpaction() { - global $g, $config, $d_shaperconfdirty_path; + global $g, $config; /* save the new configuration */ apply_all_choosen_items(); @@ -391,7 +391,7 @@ function step8_stepsubmitphpaction() { filter_configure(); /* And we're no longer dirty! */ - unlink_if_exists($d_shaperconfdirty_path); + clear_subsystem_dirty('shaper'); update_filter_reload_status("Initializing"); -- cgit v1.1