From 8893861c05844ae46213fa71c8766f18ef727e8f Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Mon, 27 Jul 2009 13:55:50 +0000 Subject: [PATCH] * (bug 18407, bug 18409) Special:Upload is now listed on Special:Specialpages only if uploads are enabled and the user can access it 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 | 2 ++ includes/specials/SpecialUpload.php | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9d0ac6ea4f..160b81ce34 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 6945db2f2f..f2a3a94ba5 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -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 -- 2.20.1