* Honor upload restrictions in SpecialUpload.php and FileRevertForm.php
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Mon, 28 Apr 2008 17:08:29 +0000 (17:08 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Mon, 28 Apr 2008 17:08:29 +0000 (17:08 +0000)
* Add 'restriction-upload' => 'Upload' to MessageEn.php

includes/FileRevertForm.php
includes/SpecialUpload.php
languages/messages/MessagesEn.php

index e4401d0..6b845ab 100644 (file)
@@ -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 );
index f0a36d6..25ee62e 100644 (file)
@@ -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;
                }
 
index eeab3ba..66a8aab 100644 (file)
@@ -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',