From: Reini U. <ru...@us...> - 2004-09-25 16:24:15
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28386 Modified Files: PagePerm.php Log Message: fix interesting PagePerm problem: -1 == true Index: PagePerm.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/PagePerm.php,v retrieving revision 1.29 retrieving revision 1.30 diff -u -2 -b -p -d -r1.29 -r1.30 --- PagePerm.php 3 Jul 2004 08:04:19 -0000 1.29 +++ PagePerm.php 25 Sep 2004 16:24:02 -0000 1.30 @@ -157,9 +157,10 @@ function mayAccessPage ($access, $pagena */ function requiredAuthorityForPage ($action) { + global $request; $auth = _requiredAuthorityForPagename(action2access($action), - $GLOBALS['request']->getArg('pagename')); + $request->getArg('pagename')); assert($auth !== -1); if ($auth) - return $GLOBALS['request']->_user->_level; + return $request->_user->_level; else return WIKIAUTH_UNOBTAINABLE; @@ -233,5 +234,5 @@ function _requiredAuthorityForPagename($ // ACL defined; check if isAuthorized returns true or false or undecided $authorized = $perm->isAuthorized($access, $request->_user); - if ($authorized != -1) // -1 for undecided + if ($authorized !== 'undecided') // interestingly true is also -1, so we use a string return $authorized; else @@ -348,5 +349,5 @@ class PagePermission { } } - return -1; // undecided + return 'undecided'; // undecided } @@ -699,4 +700,7 @@ class PagePermission { // $Log$ +// Revision 1.30 2004/09/25 16:24:02 rurban +// fix interesting PagePerm problem: -1 == true +// // Revision 1.29 2004/07/03 08:04:19 rurban // fixed implicit PersonalPage login (e.g. on edit), fixed to check against create ACL on create, not edit |