summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system_routes.php
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2005-03-24 05:57:48 +0000
committerBill Marquette <billm@pfsense.org>2005-03-24 05:57:48 +0000
commit2b87adaef5c78bfa6220fff9b9998d3b9c171838 (patch)
tree4d9798a6a9977e6d5689d3c98331c3eb49158774 /usr/local/www/system_routes.php
parent0390c50a8b7ba5ba3dc52ffc274fe31645b63467 (diff)
downloadpfsense-2b87adaef5c78bfa6220fff9b9998d3b9c171838.zip
pfsense-2b87adaef5c78bfa6220fff9b9998d3b9c171838.tar.gz
write_config() descriptions and only write_config() if something actually changed
Diffstat (limited to 'usr/local/www/system_routes.php')
-rwxr-xr-xusr/local/www/system_routes.php28
1 files changed, 18 insertions, 10 deletions
diff --git a/usr/local/www/system_routes.php b/usr/local/www/system_routes.php
index 0d870dc..043f74c 100755
--- a/usr/local/www/system_routes.php
+++ b/usr/local/www/system_routes.php
@@ -36,17 +36,10 @@ if (!is_array($config['staticroutes']['route']))
staticroutes_sort();
$a_routes = &$config['staticroutes']['route'];
+$changedesc = "Static Routes: ";
if ($_POST) {
- if ($_POST['enablefastrouting'] == "") {
- unset($config['staticroutes']['enablefastrouting']);
- write_config();
- } else {
- $config['staticroutes']['enablefastrouting'] = "enabled";
- write_config();
- }
-
$pconfig = $_POST;
if ($_POST['apply']) {
@@ -64,14 +57,29 @@ if ($_POST) {
config_unlock();
}
}
+ } else {
+ if ($_POST['enablefastrouting'] == "") {
+ /* Only update config if something changed */
+ if (isset($config['staticroutes']['enablefastrouting'])) {
+ $changedesc .= " disable fast routing";
+ unset($config['staticroutes']['enablefastrouting']);
+ write_config($changedesc);
+ }
+ } else {
+ /* Only update config if something changed */
+ if (!isset($config['staticroutes']['enablefastrouting'])) {
+ $changedesc .= " enable fast routing";
+ $config['staticroutes']['enablefastrouting'] = "enabled";
+ write_config($changedesc);
+ }
+ }
}
-
}
if ($_GET['act'] == "del") {
if ($a_routes[$_GET['id']]) {
unset($a_routes[$_GET['id']]);
- write_config();
+ write_config("Static Routes: removed route to {$_GET['id']}");
touch($d_staticroutesdirty_path);
header("Location: system_routes.php");
exit;
OpenPOWER on IntegriCloud