Per comment at r50961: keep the messages saying "you need to be logged in to ......
authorRobin Pepermans <robin@users.mediawiki.org>
Tue, 26 May 2009 19:16:49 +0000 (19:16 +0000)
committerRobin Pepermans <robin@users.mediawiki.org>
Tue, 26 May 2009 19:16:49 +0000 (19:16 +0000)
includes/Title.php
includes/specials/SpecialUpload.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index 74cd6f0..baea55e 100644 (file)
@@ -1171,7 +1171,14 @@ class Title {
                        
                        if( !$user->isAllowed( 'move' ) ) {
                                // User can't move anything
-                               $errors[] = array ('movenotallowed');
+                               global $wgGroupPermissions;
+                               if( $user->isAnon() && ( $wgGroupPermissions['user']['move']
+                               || $wgGroupPermissions['autoconfirmed']['move'] ) ) {
+                                       // custom message if logged-in users without any special rights can move
+                                       $errors[] = array ( 'movenologintext' );
+                               } else {
+                                       $errors[] = array ('movenotallowed');
+                               }
                        }
                } elseif ( $action == 'create' ) {
                        if( ( $this->isTalkPage() && !$user->isAllowed( 'createtalk' ) ) ||
index ad8366b..fcd19ce 100644 (file)
@@ -244,8 +244,15 @@ class UploadForm {
                }
 
                # Check permissions
+               global $wgGroupPermissions;
                if( !$wgUser->isAllowed( 'upload' ) ) {
-                       $wgOut->permissionRequired( 'upload' );
+                       if( !$wgUser->isLoggedIn() && ( $wgGroupPermissions['user']['upload']
+                               || $wgGroupPermissions['autoconfirmed']['upload'] ) ) {
+                               // Custom message if logged-in users without any special rights can upload
+                               $wgOut->showErrorPage( 'uploadnologin', 'uploadnologintext' );
+                       } else {
+                               $wgOut->permissionRequired( 'upload' );
+                       }
                        return;
                }
 
index ecf49f4..7c47c0f 100644 (file)
@@ -1820,6 +1820,8 @@ Pages on [[Special:Watchlist|your watchlist]] are '''bold'''.",
 'uploadbtn'                   => 'Upload file',
 'reupload'                    => 'Re-upload',
 'reuploaddesc'                => 'Cancel upload and return to the upload form',
+'uploadnologin'               => 'Not logged in',
+'uploadnologintext'           => 'You must be [[Special:UserLogin|logged in]] to upload files.',
 'upload_directory_missing'    => 'The upload directory ($1) is missing and could not be created by the webserver.',
 'upload_directory_read_only'  => 'The upload directory ($1) is not writable by the webserver.',
 'uploaderror'                 => 'Upload error',
@@ -2773,6 +2775,8 @@ please be sure you understand the consequences of this before proceeding.",
 
 In those cases, you will have to move or merge the page manually if desired.",
 'movearticle'                  => 'Move page:',
+'movenologin'                  => 'Not logged in',
+'movenologintext'              => 'You must be a registered user and [[Special:UserLogin|logged in]] to move a page.',
 'movenotallowed'               => 'You do not have permission to move pages.',
 'movenotallowedfile'           => 'You do not have permission to move files.',
 'cant-move-user-page'          => 'You do not have permission to move user pages (apart from subpages).',
index 22a366f..438ef5a 100644 (file)
@@ -1130,6 +1130,8 @@ $wgMessageStructure = array(
                'uploadbtn',
                'reupload',
                'reuploaddesc',
+        'uploadnologin',
+        'uploadnologintext',
                'upload_directory_missing',
                'upload_directory_read_only',
                'uploaderror',
@@ -1922,6 +1924,8 @@ $wgMessageStructure = array(
                'movepagetext',
                'movepagetalktext',
                'movearticle',
+               'movenologin',
+               'movenologintext',
                'movenotallowed',
                'movenotallowedfile',
                'cant-move-user-page',