* Improve the "uploads disabled" warning
authorRob Church <robchurch@users.mediawiki.org>
Wed, 11 Jan 2006 03:55:37 +0000 (03:55 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Wed, 11 Jan 2006 03:55:37 +0000 (03:55 +0000)
* OutputPage::sysopRequired() ==> OutputPage::permissionRequired() when blocking and uploading files

RELEASE-NOTES
includes/SpecialBlockip.php
includes/SpecialUpload.php
languages/Language.php

index 7e7dd88..d0b5524 100644 (file)
@@ -202,6 +202,7 @@ i18n / Languages:
   a such distinction
 * (bug 4548) Update for Portuguese language (pt): time format
 * (bug 4530) Use consistent name for Kurdish
+* Tweak default "upload disabled" text
 
 Parser:
 * (bug 2522) {{CURRENTDAY2}} now shows the current day number with two digits
@@ -458,6 +459,7 @@ fully support the editing toolbar, but was found to be too confusing.
   size. This is necessary to limit server memory usage.
 * Cleanup and error checking on Special:Listredirects
 * Clear up some instances of old OutputPage::sysopRequired() function usage
+* Improve "upload disabled" notice
 
 === Caveats ===
 
index c621ebe..8a1a841 100644 (file)
 function wfSpecialBlockip( $par ) {
        global $wgUser, $wgOut, $wgRequest;
 
-       if ( ! $wgUser->isAllowed('block') ) {
-               $wgOut->sysopRequired();
+       if( !$wgUser->isAllowed( 'block' ) ) {
+               $wgOut->permissionRequired( 'block' );
                return;
        }
+
        $ipb = new IPBlockForm( $par );
 
        $action = $wgRequest->getVal( 'action' );
index 9a72a9e..1ea1969 100644 (file)
@@ -99,17 +99,29 @@ class UploadForm {
                global $wgUser, $wgOut;
                global $wgEnableUploads, $wgUploadDirectory;
 
-               /** Show an error message if file upload is disabled */
-               if( ! $wgEnableUploads ) {
-                       $wgOut->addWikiText( wfMsg( 'uploaddisabled' ) );
+               # Check uploading enabled
+               if( !$wgEnableUploads ) {
+                       $wgOut->errorPage( 'uploaddisabled', 'uploaddisabledtext' );
                        return;
                }
 
-               /** Various rights checks */
-               if( !$wgUser->isAllowed( 'upload' ) || $wgUser->isBlocked() ) {
-                       $wgOut->errorpage( 'uploadnologin', 'uploadnologintext' );
+               # Check permissions
+               if( $wgUser->isLoggedIn() ) {
+                       if( !$wgUser->isAllowed( 'upload' ) ) {
+                               $wgOut->permissionRequired( 'upload' );
+                               return;
+                       }
+               } else {
+                       $wgOut->errorPage( 'uploadnologin', 'uploadnologintext' );
+                       return;
+               }       
+
+               # Check blocks
+               if( $wgUser->isBlocked() ) {
+                       $wgOut->blockedPage();
                        return;
                }
+
                if( wfReadOnly() ) {
                        $wgOut->readOnlyPage();
                        return;
index 04f6d33..8667917 100644 (file)
@@ -1056,7 +1056,8 @@ created and by whom, and anything else you may know about it. If this is an imag
 'uploadwarning' => 'Upload warning',
 'savefile'             => 'Save file',
 'uploadedimage' => "uploaded \"[[$1]]\"",
-'uploaddisabled' => 'Sorry, uploading is disabled.',
+'uploaddisabled' => 'Uploads disabled',
+'uploaddisabledtext' => 'File uploads are disabled on this wiki.',
 'uploadscripted' => 'This file contains HTML or script code that my be erroneously be interpreted by a web browser.',
 'uploadcorrupt' => 'The file is corrupt or has an incorrect extension. Please check the file and upload again.',
 'uploadvirus' => 'The file contains a virus! Details: $1',