From 38df17d714871dadd2a769d83c9eb160130b900a Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Sun, 16 Jul 2006 12:43:15 +0000 Subject: [PATCH] Fixing a comment, and using SpecialPage::userCanExecute as a wrapper to to User::isAllowed. --- includes/SpecialPage.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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 ); } /** -- 2.20.1