* 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
This commit is contained in:
Ermal Lui 2009-06-30 17:11:30 +00:00
parent 6819b7f60c
commit a368a026db
66 changed files with 229 additions and 272 deletions

View File

@ -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();
?>
?>

View File

@ -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() {
}
?>
?>

View File

@ -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

View File

@ -2,18 +2,15 @@
<?php
$g['booting'] = true;
require("globals.inc");
$g['booting'] = true;
echo "Starting the {$g['product_name']} console firmware update system";
require("functions.inc");
echo ".";
require("config.inc");
echo ".";
$g['booting'] = false;
$d_fwupenabled_path = $g['varrun_path'] . "/fwup.enabled";
$g['booting'] = false;
$fp = fopen('php://stdin', 'r');
@ -46,7 +43,7 @@ switch ($command) {
$status = does_url_exist($url);
if($status) {
conf_mount_rw();
touch($d_fwupenabled_path);
mark_subsystem_dirty('firmware');
if(file_exists("/root/firmware.tgz"))
unlink("/root/firmware.tgz");
echo "\nFetching file size...\n";
@ -116,7 +113,7 @@ switch ($command) {
if(stristr($fp,"bdiff"))
$type = "nanobsd";
if(file_exists($path)) {
touch($d_fwupenabled_path);
mark_subsystem_dirty('firmware');
do_upgrade($path, $type);
} else {
echo "\nCould not find file.\n\n";
@ -163,7 +160,7 @@ function check_for_kernel_file() {
function do_upgrade($path, $type) {
global $g;
touch($g['varrun_path'] . "/firmware.lock");
mark_subsystem_dirty('firmwarelock');
check_for_kernel_file();
echo "\nOne moment please...\nInvoking firmware upgrade...";
if($type == "bdiff")
@ -173,17 +170,16 @@ function do_upgrade($path, $type) {
else
mwexec_bg("/etc/rc.firmware pfSenseupgrade $path");
sleep(10);
while(file_exists("{$g['varrun_path']}/firmware.lock")) {
while(is_subsystem_dirty('firmwarelock')) {
sleep(1);
echo ".";
}
sleep(10);
echo "Done. Rebooting...\n\n";
if(file_exists($g['varrun_path'] . "/firmware.lock"))
unlink($g['varrun_path'] . "/firmware.lock");
clear_subsystem_dirty('firmwarelock');
}
exec("rm -f /root/*.md5");
fclose($fp);
?>
?>

View File

@ -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");
<?php include("fbegin.inc"); ?>
<form action="firewall_aliases.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_aliasesdirty_path)): ?><p>
<?php if (is_subsystem_dirty('aliases')): ?><p>
<?php print_info_box_np("The alias list has been changed.<br>You must apply the changes in order for them to take effect.");?>
<?php endif; ?>

View File

@ -221,7 +221,7 @@ if ($_POST) {
else
$a_aliases[] = $alias;
touch($d_aliasesdirty_path);
mark_subsystem_dirty('aliases');
write_config();
filter_configure();

View File

@ -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 "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript
<?php include("fbegin.inc"); ?>
<form action="firewall_nat.php" method="post" name="iform">
<script type="text/javascript" language="javascript" src="/javascript/row_toggle.js"></script>
<?php if (file_exists($d_natconfdirty_path)): ?><p>
<?php if (is_subsystem_dirty('natconf')): ?><p>
<?php
if($savemsg)
print_info_box_np("{$savemsg}<br>The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect.");

View File

@ -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");
<?php include("fbegin.inc"); ?>
<form action="firewall_nat_1to1.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_natconfdirty_path)): ?><p>
<?php if (is_subsystem_dirty('natconf')): ?><p>
<?php print_info_box_np("The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td>

View File

@ -128,7 +128,7 @@ if ($_POST) {
else
$a_1to1[] = $natent;
touch($d_natconfdirty_path);
mark_subsystem_dirty('natconf');
write_config();

View File

@ -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();

View File

@ -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");
<script type="text/javascript" language="javascript" src="/javascript/row_toggle.js">
</script>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_natconfdirty_path)): ?><p>
<?php if (is_subsystem_dirty('natconf')): ?><p>
<?php print_info_box_np("The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td>

View File

@ -234,7 +234,7 @@ if ($_POST) {
$a_out[] = $natent;
}
touch($d_natconfdirty_path);
mark_subsystem_dirty('natconf');
write_config();

View File

@ -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");
<form action="firewall_nat_server.php" method="post">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_natconfdirty_path)): ?><p>
<?php if (is_subsystem_dirty('natconf')): ?><p>
<?php print_info_box_np("The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td>

View File

@ -110,7 +110,7 @@ if ($_POST) {
} else
$a_snat[] = $natent;
touch($d_natconfdirty_path);
mark_subsystem_dirty('natconf');
write_config();

View File

@ -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 <a href='status_filter_reload.php'>monitor</a> 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 "<script type=\"text/javascript\" language=\"javascript\" src=\"/javascript
<script type="text/javascript" language="javascript" src="/javascript/row_toggle.js">
</script>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_filterconfdirty_path)): ?><p>
<?php if (is_subsystem_dirty('filter')): ?><p>
<?php print_info_box_np("The firewall rule configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -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");

View File

@ -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");
<form action="firewall_shaper.php" method="post" id="iform" name="iform">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_shaperconfdirty_path)): ?><p>
<?php if (is_subsystem_dirty('shaper')): ?><p>
<?php print_info_box_np("The traffic shaper configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -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");
<form action="firewall_shaper_layer7.php" method="post" id="iform" name="iform">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_shaperconfdirty_path)): ?><p>
<?php if (is_subsystem_dirty('shaper')): ?><p>
<?php print_info_box_np("The traffic shaper configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -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");
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="firewall_shaper_queues.php" method="post" name="iform" id="iform">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_shaperconfdirty_path)): ?><p>
<?php if (is_subsystem_dirty('shaper')): ?><p>
<?php print_info_box_np("The traffic shaper configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -1,7 +1,7 @@
<?php
/* $Id$ */
/*
firewall_shaper.php
firewall_shaper_vinterface.php
Copyright (C) 2004, 2005 Scott Ullrich
Copyright (C) 2008 Ermal Luçi
All rights reserved.
@ -87,7 +87,7 @@ if ($_GET) {
if ($queue) {
$queue->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");
<form action="firewall_shaper_vinterface.php" method="post" id="iform" name="iform">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_shaperconfdirty_path)): ?><p>
<?php if (is_subsystem_dirty('shaper')): ?><p>
<?php print_info_box_np("The traffic shaper configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -1,7 +1,7 @@
<?php
/* $Id$ */
/*
firewall_shaper.php
firewall_shaper_wizards.php
Copyright (C) 2004, 2005 Scott Ullrich
Copyright (C) 2008 Ermal Luçi
All rights reserved.
@ -60,7 +60,7 @@ if ($_POST['apply']) {
system("rm -f /var/db/rrd/*queues.rrd");
enable_rrd_graphing();
unlink($d_shaperconfdirty_path);
clear_subsystem_dirty('shaper');
}
$pgtitle = array("Firewall", "Traffic Shaper", "Wizards");
@ -84,7 +84,7 @@ include("fbegin.inc");
<form action="firewall_shaper_wizards.php" method="post" id="iform" name="iform">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_shaperconfdirty_path)): ?><p>
<?php if (is_subsystem_dirty('shaper')): ?><p>
<?php print_info_box_np("The traffic shaper configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -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.<br>You must apply the changes in order for them to take effect.");
?>
<br>

View File

@ -205,7 +205,7 @@ if ($_POST) {
} else
$a_vip[] = $vipent;
touch($d_vipconfdirty_path);
mark_subsystem_dirty('vip');
write_config();

View File

@ -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;
}
?>
?>

View File

@ -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"
<?php include("fbegin.inc"); ?>
<form action="interfaces.php" method="post" name="iform" id="iform">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if (file_exists($d_landirty_path)): ?><p>
<?php if (is_subsystem_dirty('interfaces')): ?><p>
<?php print_info_box_np(gettext("The {$wancfg['descr']} configuration has been changed.<p>You must apply the changes in order for them to take effect.<p>Don't forget to adjust the DHCP Server range if needed before applying."));?><br />
<?php endif; ?>
<?php if ($savemsg) print_info_box($savemsg); ?>

View File

@ -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");
<form action="load_balancer_monitor.php" method="post">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_vsconfdirty_path)): ?><p>
<?php if (is_subsystem_dirty('loadbalancer')): ?><p>
<?php print_info_box_np("The load balancer configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -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);
}

View File

@ -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");
<form action="load_balancer_pool.php" method="post">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_vsconfdirty_path)): ?><p>
<?php if (is_subsystem_dirty('loadbalancer')): ?><p>
<?php print_info_box_np("The load balancer configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -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);
}

View File

@ -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");
<form action="load_balancer_relay_action.php" method="post">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_vsconfdirty_path)): ?><p>
<?php if (is_subsystem_dirty('loadbalancer')): ?><p>
<?php print_info_box_np("The load balancer configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -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);
}

View File

@ -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");
<form action="load_balancer_relay_protocol.php" method="post">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_vsconfdirty_path)): ?><p>
<?php if (is_subsystem_dirty('loadbalancer')): ?><p>
<?php print_info_box_np("The load balancer configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -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);
}

View File

@ -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");
<form action="load_balancer_virtual_server.php" method="post">
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_vsconfdirty_path)): ?><p>
<?php if (is_subsystem_dirty('loadbalancer')): ?><p>
<?php print_info_box_np("The virtual server configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -114,7 +114,7 @@ if ($_POST) {
if ($changecount > 0) {
/* Mark virtual server dirty */
touch($d_vsconfdirty_path);
mark_subsystem_dirty('loadbalancer');
write_config($changedesc);
}

View File

@ -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");
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<form action="services_captiveportal_ip.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_allowedipsdirty_path)): ?>
<?php if (is_subsystem_dirty('allowedips')): ?>
<?php print_info_box_np("The captive portal IP address configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -93,7 +93,7 @@ if ($_POST) {
write_config();
touch($d_allowedipsdirty_path) ;
mark_subsystem_dirty('allowedips');
header("Location: services_captiveportal_ip.php");
exit;

View File

@ -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");
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<form action="services_captiveportal_mac.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_passthrumacsdirty_path)): ?><p>
<?php if (is_subsystem_dirty('passthrumac')): ?><p>
<?php print_info_box_np("The captive portal MAC address configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -93,7 +93,7 @@ if ($_POST) {
write_config();
touch($d_passthrumacsdirty_path) ;
mark_subsystem_dirty('passthrumac');
header("Location: services_captiveportal_mac.php");
exit;

View File

@ -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;
}
?>
<?php if (file_exists($d_staticmapsdirty_path)): ?><p>
<?php if (is_subsystem_dirty('staticmaps')): ?><p>
<?php print_info_box_np("The static mapping configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -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}");

View File

@ -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) {
<?php include("fbegin.inc"); ?>
<form action="services_dnsmasq.php" method="post" name="iform" id="iform">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_hostsdirty_path)): ?><p>
<?php if (is_subsystem_dirty('hosts')): ?><p>
<?php print_info_box_np("The DNS forwarder configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="6" cellspacing="0">

View File

@ -82,7 +82,7 @@ if ($_POST) {
else
$a_domainOverrides[] = $doment;
touch($d_dnsmasqdirty_path);
mark_subsystem_dirty('dnsmasq');
write_config();

View File

@ -99,7 +99,7 @@ if ($_POST) {
else
$a_hosts[] = $hostent;
touch($d_hostsdirty_path);
mark_subsystem_dirty('hosts');
write_config();

View File

@ -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");
<?php include("fbegin.inc"); ?>
<form action="services_proxyarp.php" method="post">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_proxyarpdirty_path)): ?><p>
<?php if (is_subsystem_dirty('proxyarp')): ?><p>
<?php print_info_box_np("The proxy ARP configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -130,7 +130,7 @@ if ($_POST) {
else
$a_proxyarp[] = $arpent;
touch($d_proxyarpdirty_path);
mark_subsystem_dirty('proxyarp');
write_config();

View File

@ -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.");
?>
</form>

View File

@ -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 "<body link=\"#0000CC\" vlink=\"#0000CC\" alink=\"#0000CC\">\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);
<input name="sig_override" type="submit" class="formbtn" id="sig_override" value=" Yes ">
<input name="sig_no" type="submit" class="formbtn" id="sig_no" value=" No ">
<?php else: ?>
<?php if (!file_exists($d_firmwarelock_path)): ?>
<?php if (!is_subsystem_dirty('firmwarelock')): ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
@ -209,8 +207,8 @@ print_info_box($sig_warning);
Click &quot;Upgrade firmware&quot;
to start the upgrade process.
</p>
<?php if (!file_exists($d_sysrebootreqd_path)): ?>
<?php if (!file_exists($d_fwupenabled_path)): ?>
<?php if (!is_subsystem_dirty('rebootreq')): ?>
<?php if (!is_subsystem_dirty('firmware')): ?>
<input name="Submit" type="submit" class="formbtn" value="Enable firmware upload">
<?php else: ?>
<input name="Submit" type="submit" class="formbtn" value="Disable firmware upload">

View File

@ -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");
<form action="system_gateway_groups.php" method="post">
<input type="hidden" name="y1" value="1">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_staticroutesdirty_path)): ?><p>
<?php if (is_subsystem_dirty('staticroutes')): ?><p>
<?php print_info_box_np("The gateway configuration has been changed.<br>You must apply the changes in order for them to take
effect.");?><br>
<?php endif; ?>

View File

@ -126,7 +126,7 @@ if ($_POST) {
else
$a_gateway_groups[] = $gateway_group;
touch($d_staticroutesdirty_path);
mark_subsystem_dirty('staticroutes');
write_config();

View File

@ -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");
<form action="system_gateways.php" method="post">
<input type="hidden" name="y1" value="1">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_staticroutesdirty_path)): ?><p>
<?php if (is_subsystem_dirty('staticroutes')): ?><p>
<?php print_info_box_np("The gateway configuration has been changed.<br>You must apply the changes in order for them to take
effect.");?><br>
<?php endif; ?>

View File

@ -156,7 +156,7 @@ if ($_POST) {
}
}
touch($d_staticroutesdirty_path);
mark_subsystem_dirty('staticroutes');
write_config();

View File

@ -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");
<form action="system_routes.php" method="post">
<input type="hidden" name="y1" value="1">
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (file_exists($d_staticroutesdirty_path)): ?><p>
<?php if (is_subsystem_dirty('staticroutes')): ?><p>
<?php print_info_box_np("The static route configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
<?php endif; ?>

View File

@ -117,7 +117,7 @@ if ($_POST) {
else
$a_routes[] = $route;
touch($d_staticroutesdirty_path);
mark_subsystem_dirty('staticroutes');
write_config();

View File

@ -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");
<?php
if ($savemsg)
print_info_box($savemsg);
if ($pconfig['enable'] && file_exists($d_ipsecconfdirty_path))
if ($pconfig['enable'] && is_subsystem_dirty('ipsec'))
print_info_box_np("The IPsec tunnel configuration has been changed.<br>You must apply the changes in order for them to take effect.");
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -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() {
<?php
if ($savemsg)
print_info_box($savemsg);
if (isset($config['ipsec']['enable']) && file_exists($d_ipsecconfdirty_path))
if (isset($config['ipsec']['enable']) && is_subsystem_dirty('ipsec'))
print_info_box_np("The IPsec tunnel configuration has been changed.<br>You must apply the changes in order for them to take effect.");
foreach ($a_phase1 as $ph1ent)
if (isset($ph1ent['mobile']))

View File

@ -321,7 +321,7 @@ if ($_POST) {
}
}
write_config();
touch($d_ipsecconfdirty_path);
mark_subsystem_dirty('ipsec');
header("Location: vpn_ipsec.php");
exit;

View File

@ -189,7 +189,7 @@ if ($_POST) {
}
write_config();
touch($d_ipsecconfdirty_path);
mark_subsystem_dirty('ipsec');
header("Location: vpn_ipsec.php");
exit;

View File

@ -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);

View File

@ -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");
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (isset($config['pppoe']['radius']['enable']))
print_info_box("Warning: RADIUS is enabled. The local user database will not be used."); ?>
<?php if (file_exists($d_pppoeuserdirty_path)): ?><p>
<?php if (is_subsystem_dirty('pppoeusers')): ?><p>
<?php print_info_box_np("The PPPoE user list has been modified.<br>You must apply the changes in order for them to take effect.<br><b>Warning: this will terminate all current PPPoE sessions!</b>");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -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");
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (isset($config['pptpd']['radius']['enable']))
print_info_box("Warning: RADIUS is enabled. The local user database will not be used."); ?>
<?php if (file_exists($d_pptpuserdirty_path)): ?><p>
<?php if (is_subsystem_dirty('pptpusers')): ?><p>
<?php print_info_box_np("The PPTP user list has been modified.<br>You must apply the changes in order for them to take effect.<br><b>Warning: this will terminate all current PPTP sessions!</b>");?><br>
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">

View File

@ -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;

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");