* (bug 18407, bug 18409) Special:Upload is now listed on Special:Specialpages only...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 27 Jul 2009 13:55:50 +0000 (13:55 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 27 Jul 2009 13:55:50 +0000 (13:55 +0000)
As side effect: this means Special:Upload is now displayed as restricted for users having the "upload" right, dunno if we should have some kind of whitelist for special pages accessible to some defined groups

RELEASE-NOTES
includes/specials/SpecialUpload.php

index 9d0ac6e..160b81c 100644 (file)
@@ -338,6 +338,8 @@ this. Was used when mwEmbed was going to be an extension.
   content's language
 * (bug 19479) Show proper error message when unable to connect to PostgreSQL
   database with username/password in MediaWiki's setup
+* (bugs 18407, 18409) Special:Upload is now listed on Special:Specialpages only
+  if uploads are enabled and the user can access it
 
 == API changes in 1.16 ==
 
index 6945db2..f2a3a94 100644 (file)
@@ -33,7 +33,7 @@ class UploadForm extends SpecialPage {
         * @param $request Data posted.
         */
        function __construct( $request = null ) {
-               parent::__construct( 'Upload' );
+               parent::__construct( 'Upload', 'upload' );
                $this->mRequest = $request;
        }
 
@@ -82,7 +82,11 @@ class UploadForm extends SpecialPage {
                $this->mAction            = $request->getVal( 'action' );
                $this->mUpload            = UploadBase::createFromRequest( $request );
        }
-       
+
+       public function userCanExecute( $user ) {
+               return UploadBase::isEnabled() && parent::userCanExecute( $user );
+       }
+
        /**
         * Start doing stuff
         * @access public