summaryrefslogtreecommitdiffstats
path: root/usr/local/www/interfaces_lan.php
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2005-03-24 05:26:29 +0000
committerBill Marquette <billm@pfsense.org>2005-03-24 05:26:29 +0000
commit52442f576c913c7da3d582555f8fb4ec43784db0 (patch)
tree11e25d780e10c431801a30f594fc28395a30288e /usr/local/www/interfaces_lan.php
parentfc13ca75057d49aa6d4c262f1c51485ac7ba40fb (diff)
downloadpfsense-52442f576c913c7da3d582555f8fb4ec43784db0.zip
pfsense-52442f576c913c7da3d582555f8fb4ec43784db0.tar.gz
Don't require a reboot for trivial changes such as bandwidth change
Fully log what changed on write_config()
Diffstat (limited to 'usr/local/www/interfaces_lan.php')
-rwxr-xr-xusr/local/www/interfaces_lan.php31
1 files changed, 25 insertions, 6 deletions
diff --git a/usr/local/www/interfaces_lan.php b/usr/local/www/interfaces_lan.php
index e133da2..fa0f0e6 100755
--- a/usr/local/www/interfaces_lan.php
+++ b/usr/local/www/interfaces_lan.php
@@ -48,6 +48,7 @@ if ($_POST) {
unset($input_errors);
$pconfig = $_POST;
+ $changedesc = "LAN Interface: ";
/* input validation */
$reqdfields = explode(" ", "ipaddr subnet");
@@ -71,19 +72,37 @@ if ($_POST) {
}
if (!$input_errors) {
- $lancfg['ipaddr'] = $_POST['ipaddr'];
- $lancfg['subnet'] = $_POST['subnet'];
- $lancfg['bandwidth'] = $_POST['bandwidth'];
- $lancfg['bandwidthtype'] = $_POST['bandwidthtype'];
+ if (($lancfg['ipaddr'] != $_POST['ipaddr']) || ($lancfg['subnet'] != $_POST['subnet'])) {
+ if (($pconfig['ipaddr'] != $_POST['ipaddr'])) {
+ $changedesc .= " IP changed from {$lancfg['ipaddr']} to {$_POST['ipaddr']}";
+ $lancfg['ipaddr'] = $_POST['ipaddr'];
+ }
+ if (($lancfg['subnet'] != $_POST['subnet'])) {
+ $changedesc .= " subnet changed from {$lancfg['subnet']} to {$_POST['subnet']}";
+ $lancfg['subnet'] = $_POST['subnet'];
+ }
+
+ /* We'll need to reboot after this */
+ touch($d_sysrebootreqd_path);
+ }
+
+ if ($lancfg['bandwidth'] != $_POST['bandwidth']) {
+ $changedesc .= " bandwidth changed from {$lancfg['bandwidth']} to {$_POST['bandwidth']}";
+ $lancfg['bandwidth'] = $_POST['bandwidth'];
+ }
+ if ($lancfg['bandwidthtype'] != $_POST['bandwidthtype']) {
+ $changedesc .= " bandwidth type changed from {$lancfg['bandwidthtype']} to {$_POST['bandwidth']}";
+ $lancfg['bandwidthtype'] = $_POST['bandwidthtype'];
+ }
$dhcpd_was_enabled = 0;
if (isset($config['dhcpd']['enable'])) {
unset($config['dhcpd']['enable']);
$dhcpd_was_enabled = 1;
+ $changedesc .= " DHCP was disabled";
}
- write_config();
- touch($d_sysrebootreqd_path);
+ write_config($changedesc);
$savemsg = get_std_save_message(0);
OpenPOWER on IntegriCloud