Index: trunk/phase3/includes/SpecialBlockip.php |
— | — | @@ -12,10 +12,11 @@ |
13 | 13 | function wfSpecialBlockip( $par ) { |
14 | 14 | global $wgUser, $wgOut, $wgRequest; |
15 | 15 | |
16 | | - if ( ! $wgUser->isAllowed('block') ) { |
17 | | - $wgOut->sysopRequired(); |
| 16 | + if( !$wgUser->isAllowed( 'block' ) ) { |
| 17 | + $wgOut->permissionRequired( 'block' ); |
18 | 18 | return; |
19 | 19 | } |
| 20 | + |
20 | 21 | $ipb = new IPBlockForm( $par ); |
21 | 22 | |
22 | 23 | $action = $wgRequest->getVal( 'action' ); |
Index: trunk/phase3/includes/SpecialUpload.php |
— | — | @@ -99,17 +99,29 @@ |
100 | 100 | global $wgUser, $wgOut; |
101 | 101 | global $wgEnableUploads, $wgUploadDirectory; |
102 | 102 | |
103 | | - /** Show an error message if file upload is disabled */ |
104 | | - if( ! $wgEnableUploads ) { |
105 | | - $wgOut->addWikiText( wfMsg( 'uploaddisabled' ) ); |
| 103 | + # Check uploading enabled |
| 104 | + if( !$wgEnableUploads ) { |
| 105 | + $wgOut->errorPage( 'uploaddisabled', 'uploaddisabledtext' ); |
106 | 106 | return; |
107 | 107 | } |
108 | 108 | |
109 | | - /** Various rights checks */ |
110 | | - if( !$wgUser->isAllowed( 'upload' ) || $wgUser->isBlocked() ) { |
111 | | - $wgOut->errorpage( 'uploadnologin', 'uploadnologintext' ); |
| 109 | + # Check permissions |
| 110 | + if( $wgUser->isLoggedIn() ) { |
| 111 | + if( !$wgUser->isAllowed( 'upload' ) ) { |
| 112 | + $wgOut->permissionRequired( 'upload' ); |
| 113 | + return; |
| 114 | + } |
| 115 | + } else { |
| 116 | + $wgOut->errorPage( 'uploadnologin', 'uploadnologintext' ); |
112 | 117 | return; |
| 118 | + } |
| 119 | + |
| 120 | + # Check blocks |
| 121 | + if( $wgUser->isBlocked() ) { |
| 122 | + $wgOut->blockedPage(); |
| 123 | + return; |
113 | 124 | } |
| 125 | + |
114 | 126 | if( wfReadOnly() ) { |
115 | 127 | $wgOut->readOnlyPage(); |
116 | 128 | return; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -202,6 +202,7 @@ |
203 | 203 | a such distinction |
204 | 204 | * (bug 4548) Update for Portuguese language (pt): time format |
205 | 205 | * (bug 4530) Use consistent name for Kurdish |
| 206 | +* Tweak default "upload disabled" text |
206 | 207 | |
207 | 208 | Parser: |
208 | 209 | * (bug 2522) {{CURRENTDAY2}} now shows the current day number with two digits |
— | — | @@ -458,6 +459,7 @@ |
459 | 460 | size. This is necessary to limit server memory usage. |
460 | 461 | * Cleanup and error checking on Special:Listredirects |
461 | 462 | * Clear up some instances of old OutputPage::sysopRequired() function usage |
| 463 | +* Improve "upload disabled" notice |
462 | 464 | |
463 | 465 | === Caveats === |
464 | 466 | |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -1056,7 +1056,8 @@ |
1057 | 1057 | 'uploadwarning' => 'Upload warning', |
1058 | 1058 | 'savefile' => 'Save file', |
1059 | 1059 | 'uploadedimage' => "uploaded \"[[$1]]\"", |
1060 | | -'uploaddisabled' => 'Sorry, uploading is disabled.', |
| 1060 | +'uploaddisabled' => 'Uploads disabled', |
| 1061 | +'uploaddisabledtext' => 'File uploads are disabled on this wiki.', |
1061 | 1062 | 'uploadscripted' => 'This file contains HTML or script code that my be erroneously be interpreted by a web browser.', |
1062 | 1063 | 'uploadcorrupt' => 'The file is corrupt or has an incorrect extension. Please check the file and upload again.', |
1063 | 1064 | 'uploadvirus' => 'The file contains a virus! Details: $1', |