Update
[lhc/web/wiklou.git] / includes / SpecialPage.php
index 98d5067..9193e1c 100644 (file)
@@ -112,13 +112,14 @@ class SpecialPage
                'Ancientpages'              => array( 'SpecialPage', 'Ancientpages' ),
                'Deadendpages'              => array( 'SpecialPage', 'Deadendpages' ),
                'Protectedpages'            => array( 'SpecialPage', 'Protectedpages' ),
+               'Protectedtitles'           => array( 'SpecialPage', 'Protectedtitles' ),
                'Allpages'                  => array( 'IncludableSpecialPage', 'Allpages' ),
                'Prefixindex'               => array( 'IncludableSpecialPage', 'Prefixindex' ) ,
                'Ipblocklist'               => array( 'SpecialPage', 'Ipblocklist' ),
                'Specialpages'              => array( 'UnlistedSpecialPage', 'Specialpages' ),
                'Contributions'             => array( 'SpecialPage', 'Contributions' ),
                'Emailuser'                 => array( 'UnlistedSpecialPage', 'Emailuser' ),
-               'Whatlinkshere'             => array( 'UnlistedSpecialPage', 'Whatlinkshere' ),
+               'Whatlinkshere'             => array( 'SpecialPage', 'Whatlinkshere' ),
                'Recentchangeslinked'       => array( 'UnlistedSpecialPage', 'Recentchangeslinked' ),
                'Movepage'                  => array( 'UnlistedSpecialPage', 'Movepage' ),
                'Blockme'                   => array( 'UnlistedSpecialPage', 'Blockme' ),
@@ -134,11 +135,11 @@ class SpecialPage
                'Import'                    => array( 'SpecialPage', 'Import', 'import' ),
                'Lockdb'                    => array( 'SpecialPage', 'Lockdb', 'siteadmin' ),
                'Unlockdb'                  => array( 'SpecialPage', 'Unlockdb', 'siteadmin' ),
-               'Userrights'                => array( 'SpecialPage', 'Userrights', 'userrights' ),
+               'Userrights'                => array( 'SpecialPage', 'Userrights' ),
                'MIMEsearch'                => array( 'SpecialPage', 'MIMEsearch' ),
                'Unwatchedpages'            => array( 'SpecialPage', 'Unwatchedpages', 'unwatchedpages' ),
                'Listredirects'             => array( 'SpecialPage', 'Listredirects' ),
-               'Revisiondelete'            => array( 'SpecialPage', 'Revisiondelete', 'deleterevision' ),
+               'Revisiondelete'            => array( 'UnlistedSpecialPage', 'Revisiondelete', 'deleterevision' ),
                'Unusedtemplates'           => array( 'SpecialPage', 'Unusedtemplates' ),
                'Randomredirect'            => array( 'SpecialPage', 'Randomredirect' ),
                'Withoutinterwiki'          => array( 'SpecialPage', 'Withoutinterwiki' ),
@@ -147,8 +148,9 @@ class SpecialPage
                'Mytalk'                    => array( 'SpecialMytalk' ),
                'Mycontributions'           => array( 'SpecialMycontributions' ),
                'Listadmins'                => array( 'SpecialRedirectToSpecial', 'Listadmins', 'Listusers', 'sysop' ),
-               'MergeHistory'              => array( 'SpecialPage', 'Mergehistory', 'mergehistory' ),
-       );
+               'MergeHistory'              => array( 'SpecialPage', 'MergeHistory', 'mergehistory' ),
+               'Listbots'                  => array( 'SpecialRedirectToSpecial', 'Listbots', 'Listusers', 'bot' ),
+               );
 
        static public $mAliases;
        static public $mListInitialised = false;
@@ -380,28 +382,6 @@ class SpecialPage
                }
                return $pages;
        }
-       
-       /**
-        * Return categorised listable log pages which are available
-        * for the current user, but not for everyone
-        * @static
-        */
-       static function getRestrictedLogs() {
-               global $wgUser, $wgLogRestrictions, $wgLogNames;
-       
-               $pages = array();
-       
-               if ( isset($wgLogRestrictions) ) {
-                       foreach ( $wgLogRestrictions as $type => $restriction ) {
-                               $page = SpecialPage::getTitleFor( 'Log', $type );
-                               if ( $restriction !='' && $restriction !='*' && $wgUser->isAllowed( $restriction ) ) {
-                                       $name = wfMsgHtml( $wgLogNames[$type] );
-                                       $pages[$name] = $page;
-                               }
-                       }
-               }
-               return $pages;
-       }
 
        /**
         * Execute a special page path.
@@ -509,6 +489,11 @@ class SpecialPage
 
        /**
         * Get the local name for a specified canonical name
+        *
+        * @param $name
+        * @param mixed $subpage Boolean false, or string
+        *
+        * @return string
         */
        static function getLocalNameFor( $name, $subpage = false ) {
                global $wgContLang;
@@ -665,7 +650,7 @@ class SpecialPage
                if ( $this->userCanExecute( $wgUser ) ) {
                        $func = $this->mFunction;
                        // only load file if the function does not exist
-                       if(!function_exists($func) and $this->mFile) {
+                       if(!is_callable($func) and $this->mFile) {
                                require_once( $this->mFile );
                        }
                        # FIXME: these hooks are broken for extensions and anything else that subclasses SpecialPage. 
@@ -673,7 +658,7 @@ class SpecialPage
                                $this->outputHeader();
                        if ( ! wfRunHooks( 'SpecialPageExecuteBeforePage', array( &$this, &$par, &$func ) ) )
                                return;
-                       $func( $par, $this );
+                       call_user_func( $func, $par, $this );
                        if ( ! wfRunHooks( 'SpecialPageExecuteAfterPage', array( &$this, &$par, &$func ) ) )
                                return;
                } else {
@@ -799,7 +784,7 @@ class SpecialRedirectToSpecial extends UnlistedSpecialPage {
 class SpecialMypage extends UnlistedSpecialPage {
        function __construct() {
                parent::__construct( 'Mypage' );
-               $this->mAllowedRedirectParams = array( 'action' );
+               $this->mAllowedRedirectParams = array( 'action' , 'preload' , 'editintro' );
        }
 
        function getRedirect( $subpage ) {
@@ -819,7 +804,7 @@ class SpecialMypage extends UnlistedSpecialPage {
 class SpecialMytalk extends UnlistedSpecialPage {
        function __construct() {
                parent::__construct( 'Mytalk' );
-               $this->mAllowedRedirectParams = array( 'action' );
+               $this->mAllowedRedirectParams = array( 'action' , 'preload' , 'editintro' );
        }
 
        function getRedirect( $subpage ) {
@@ -846,5 +831,3 @@ class SpecialMycontributions extends UnlistedSpecialPage {
                return SpecialPage::getTitleFor( 'Contributions', $wgUser->getName() );
        }
 }
-
-