(bug 5970) Need to login to upload files
authorRotem Liss <rotem@users.mediawiki.org>
Wed, 23 Aug 2006 15:26:50 +0000 (15:26 +0000)
committerRotem Liss <rotem@users.mediawiki.org>
Wed, 23 Aug 2006 15:26:50 +0000 (15:26 +0000)
This fixes a mistake in the permissions system (which shouldn't be exist), however the actual problem - anonymous users logging - is still exist.

includes/SpecialUpload.php

index 807a882..b6301f1 100644 (file)
@@ -202,13 +202,12 @@ class UploadForm {
                }
 
                # Check permissions
-               if( $wgUser->isLoggedIn() ) {
-                       if( !$wgUser->isAllowed( 'upload' ) ) {
+               if( !$wgUser->isAllowed( 'upload' ) ) {
+                       if( !$wgUser->isLoggedIn() ) {
+                               $wgOut->showErrorPage( 'uploadnologin', 'uploadnologintext' );
+                       } else {
                                $wgOut->permissionRequired( 'upload' );
-                               return;
                        }
-               } else {
-                       $wgOut->showErrorPage( 'uploadnologin', 'uploadnologintext' );
                        return;
                }