summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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