diff options
author | Bill Marquette <billm@pfsense.org> | 2005-08-07 16:17:10 +0000 |
---|---|---|
committer | Bill Marquette <billm@pfsense.org> | 2005-08-07 16:17:10 +0000 |
commit | 8b3ccf12b63df763bc1a603a8557d2670be7f02b (patch) | |
tree | 7a6f5cd501b6831641272170558c1402df81f78b /usr/local/www | |
parent | 4aa70cd8fa5d0d6dfa2dd8d8221b361e933b0af1 (diff) | |
download | pfsense-8b3ccf12b63df763bc1a603a8557d2670be7f02b.zip pfsense-8b3ccf12b63df763bc1a603a8557d2670be7f02b.tar.gz |
Show differences in arrays in $changedesc
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/guiconfig.inc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index e76deae..32f91b2 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -535,10 +535,24 @@ function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert * new = new value */ function update_if_changed($varname, & $orig, $new) { - if ($orig != $new) { - update_changedesc("{$varname}: \"{$orig}\" -> \"{$new}\""); + if (is_array($orig) && is_array($new)) { + $a_diff = array_diff($orig, $new); + foreach ($a_diff as $diff) { + update_changedesc("removed {$varname}: \"{$diff}\""); + } + $a_diff = array_diff($new, $orig); + foreach ($a_diff as $diff) { + update_changedesc("added {$varname}: \"{$diff}\""); + } $orig = $new; return true; + + } else { + if ($orig != $new) { + update_changedesc("{$varname}: \"{$orig}\" -> \"{$new}\""); + $orig = $new; + return true; + } } return false; } |