Merge "mw.Title: Rewrite from scratch (porting logic from Title.php)"
[lhc/web/wiklou.git] / includes / SpecialPage.php
index ad9618f..61630a9 100644 (file)
@@ -553,8 +553,8 @@ class SpecialPage {
         *   pages?
         */
        public function isRestricted() {
-               // DWIM: If everyone can do something, then it is not restricted
-               return $this->mRestriction != '' && !User::isEveryoneAllowed( $this->mRestriction );
+               // DWIM: If anons can do something, then it is not restricted
+               return $this->mRestriction != '' && !User::groupHasPermission( '*', $this->mRestriction );
        }
 
        /**
@@ -1229,6 +1229,15 @@ class SpecialCreateAccount extends SpecialRedirectToSpecial {
        function __construct() {
                parent::__construct( 'CreateAccount', 'Userlogin', 'signup', array( 'uselang' ) );
        }
+
+       // No reason to hide this link on Special:Specialpages
+       public function isListed() {
+               return true;
+       }
+
+       protected function getGroupName() {
+               return 'login';
+       }
 }
 /**
  * SpecialMypage, SpecialMytalk and SpecialMycontributions special pages
@@ -1386,14 +1395,30 @@ class SpecialMycontributions extends RedirectSpecialPage {
 class SpecialMyuploads extends RedirectSpecialPage {
        function __construct() {
                parent::__construct( 'Myuploads' );
-               $this->mAllowedRedirectParams = array( 'limit' );
+               $this->mAllowedRedirectParams = array( 'limit', 'ilshowall', 'ilsearch' );
+       }
+
+       function getRedirect( $subpage ) {
+               return SpecialPage::getTitleFor( 'Listfiles', $this->getUser()->getName() );
+       }
+}
+
+/**
+ * Redirect Special:Listfiles?user=$wgUser&ilshowall=true
+ */
+class SpecialAllMyUploads extends RedirectSpecialPage {
+       function __construct() {
+               parent::__construct( 'AllMyUploads' );
+               $this->mAllowedRedirectParams = array( 'limit', 'ilsearch' );
        }
 
        function getRedirect( $subpage ) {
+               $this->mAddedRedirectParams['ilshowall'] = 1;
                return SpecialPage::getTitleFor( 'Listfiles', $this->getUser()->getName() );
        }
 }
 
+
 /**
  * Redirect from Special:PermanentLink/### to index.php?oldid=###
  */