From: Rotem Liss Date: Sun, 16 Jul 2006 12:43:15 +0000 (+0000) Subject: Fixing a comment, and using SpecialPage::userCanExecute as a wrapper to to User:... X-Git-Tag: 1.31.0-rc.0~56216 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=38df17d714871dadd2a769d83c9eb160130b900a;p=lhc%2Fweb%2Fwiklou.git Fixing a comment, and using SpecialPage::userCanExecute as a wrapper to to User::isAllowed. --- diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index bd98203bca..b16af24ad2 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -410,7 +410,7 @@ class SpecialPage * and displayRestrictionError() * * @param string $name Name of the special page, as seen in links and URLs - * @param string $restriction Minimum user level required, e.g. "sysop" or "developer". + * @param string $restriction User right required, e.g. "block" or "delete" * @param boolean $listed Whether the page is listed in Special:Specialpages * @param string $function Function called by execute(). By default it is constructed from $name * @param string $file File which is included by execute(). It is also constructed from $name by default @@ -460,15 +460,7 @@ class SpecialPage * special page (as defined by $mRestriction) */ function userCanExecute( &$user ) { - if ( $this->mRestriction == "" ) { - return true; - } else { - if ( in_array( $this->mRestriction, $user->getRights() ) ) { - return true; - } else { - return false; - } - } + return $user->isAllowed( $this->mRestriction ); } /**