summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2005-08-07 16:17:10 +0000
committerBill Marquette <billm@pfsense.org>2005-08-07 16:17:10 +0000
commit8b3ccf12b63df763bc1a603a8557d2670be7f02b (patch)
tree7a6f5cd501b6831641272170558c1402df81f78b /usr/local
parent4aa70cd8fa5d0d6dfa2dd8d8221b361e933b0af1 (diff)
downloadpfsense-8b3ccf12b63df763bc1a603a8557d2670be7f02b.zip
pfsense-8b3ccf12b63df763bc1a603a8557d2670be7f02b.tar.gz
Show differences in arrays in $changedesc
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/guiconfig.inc18
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;
}
OpenPOWER on IntegriCloud