From: Bryan Tong Minh Date: Mon, 28 Apr 2008 17:08:29 +0000 (+0000) Subject: * Honor upload restrictions in SpecialUpload.php and FileRevertForm.php X-Git-Tag: 1.31.0-rc.0~48028 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=cb4cef1d1032a7d4c9f9e244798e4ce19aa44f67;p=lhc%2Fweb%2Fwiklou.git * Honor upload restrictions in SpecialUpload.php and FileRevertForm.php * Add 'restriction-upload' => 'Upload' to MessageEn.php --- diff --git a/includes/FileRevertForm.php b/includes/FileRevertForm.php index e4401d0574..6b845aba9d 100644 --- a/includes/FileRevertForm.php +++ b/includes/FileRevertForm.php @@ -38,7 +38,7 @@ class FileRevertForm { } elseif( !$wgUser->isLoggedIn() ) { $wgOut->showErrorPage( 'uploadnologin', 'uploadnologintext' ); return; - } elseif( !$this->title->userCan( 'edit' ) ) { + } elseif( !$this->title->userCan( 'edit' ) || !$this->title->userCan( 'upload' ) ) { // The standard read-only thing doesn't make a whole lot of sense // here; surely it should show the image or something? -- RC $article = new Article( $this->title ); diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index f0a36d6155..25ee62ebd7 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -436,7 +436,9 @@ class UploadForm { * If the image is protected, non-sysop users won't be able * to modify it by uploading a new revision. */ - if( !$nt->userCan( 'edit' ) || !$nt->userCan( 'create' ) ) { + if( !$nt->userCan( 'edit' ) || + !$nt->userCan( 'create' ) || + !$nt->userCan( 'upload' ) ){ return self::PROTECTED_PAGE; } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index eeab3bacb7..66a8aababa 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2156,6 +2156,7 @@ You can change this page's protection level, but it will not affect the cascadin 'restriction-edit' => 'Edit', 'restriction-move' => 'Move', 'restriction-create' => 'Create', +'restriction-upload' => 'Upload', # Restriction levels 'restriction-level-sysop' => 'full protected',