From: <var...@us...> - 2009-03-31 15:35:29
|
Revision: 6753 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6753&view=rev Author: vargenau Date: 2009-03-31 15:35:27 +0000 (Tue, 31 Mar 2009) Log Message: ----------- Do not use array_diff_assoc_recursive Modified Paths: -------------- trunk/lib/PagePerm.php Modified: trunk/lib/PagePerm.php =================================================================== --- trunk/lib/PagePerm.php 2009-03-31 15:29:20 UTC (rev 6752) +++ trunk/lib/PagePerm.php 2009-03-31 15:35:27 UTC (rev 6753) @@ -505,8 +505,12 @@ * do a recursive comparison */ function equal($otherperm) { - $diff = array_diff_assoc_recursive($this->perm, $otherperm); - return empty($diff); + // The equal function seems to be unable to detect removed perm. + // Use case is when a rule is removed. + return (print_r($this->perm, true) === print_r($otherperm, true)); + +// $diff = array_diff_assoc_recursive($this->perm, $otherperm); +// return empty($diff); } /** @@ -725,7 +729,11 @@ $none = false; $s .= "$group:"; } - $s .= " $action"; + if ($perm[$action][$group]) { + $s .= " $action"; + } else { + $s .= " -$action"; + } } } if (!($none)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |