* OutputPage::sysopRequired() ==> OutputPage::permissionRequired() when blocking and uploading files
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
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 ===
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' );
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;
'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',