Also added proper read-only checks to several special pages.
Have removed read-only checks from the general user permission framework
since it doesn't belong there; user authorization is independent from
the database's read-only state, and the way we check and present error
conditions is necessarily different. Further, as a detail it was formatting
the actual message incorrectly as an inline message when historically it's a
big block message with tables and images and stuff.
* (bug 12608) Unifying the spelling of getDBkey() in the code.
* (bug 12611) Bot flag ignored in recent changes
* (bug 12617) Decimal and thousands separators for Romanian
+* (bug 12567) Fix for misformatted read-only messages on edit, protect.
+ Also added proper read-only checks to several special pages.
+ Have removed read-only checks from the general user permission framework.
== Parser changes in 1.12 ==
# This code desperately needs to be totally rewritten
+ # Read-only check...
+ if ( wfReadOnly() ) {
+ $wgOut->readOnlyPage();
+ return;
+ }
+
# Check permissions
$permission_errors = $this->mTitle->getUserPermissionsErrors( 'delete', $wgUser );
wfProfileOut( __METHOD__ );
return;
}
+
+ if( wfReadOnly() ) {
+ $wgOut->readOnlyPage( $this->getContent() );
+ wfProfileOut( __METHOD__ );
+ return;
+ }
$permErrors = $this->mTitle->getUserPermissionsErrors('edit', $wgUser);
if( !$this->mTitle->exists() ) {
}
// The form will be available in read-only to show levels.
- $this->disabled = ($this->mPermErrors = $this->mTitle->getUserPermissionsErrors('protect',$wgUser)) != array();
+ $this->disabled = wfReadOnly() || ($this->mPermErrors = $this->mTitle->getUserPermissionsErrors('protect',$wgUser)) != array();
$this->disabledAttrib = $this->disabled
? array( 'disabled' => 'disabled' )
: array();
# Show an appropriate message if the user isn't allowed or able to change
# the protection settings at this time
if( $this->disabled ) {
- $message = $wgOut->formatPermissionsErrorMessage( $this->mPermErrors );
+ if( wfReadOnly() ) {
+ $wgOut->readOnlyPage();
+ $message = '';
+ }
+ if( $this->mPermErrors ) {
+ $message = $wgOut->formatPermissionsErrorMessage( $this->mPermErrors );
+ }
} else {
$message = wfMsg( 'protect-text', wfEscapeWikiText( $this->mTitle->getPrefixedText() ) );
}
$frompage = '';
$history = true;
+ if ( wfReadOnly() ) {
+ $wgOut->readOnlyPage();
+ return;
+ }
+
if( $wgRequest->wasPosted() && $wgRequest->getVal( 'action' ) == 'submit') {
$isUpload = false;
$namespace = $wgRequest->getIntOrNull( 'namespace' );
function undelete() {
global $wgOut, $wgUser;
+ if ( wfReadOnly() ) {
+ $wgOut->readOnlyPage();
+ return;
+ }
if( !is_null( $this->mTargetObj ) ) {
$archive = new PageArchive( $this->mTargetObj );
return;
}
+ if ( wfReadOnly() ) {
+ global $wgOut;
+ $wgOut->readOnlyPage();
+ return;
+ }
+
$this->outputHeader();
$this->setHeaders();
global $wgContLang;
global $wgLang;
-
- if ( wfReadOnly() && $action != 'read' ) {
- global $wgReadOnly;
- $errors[] = array( 'readonlytext', $wgReadOnly );
- }
-
global $wgEmailConfirmToEdit, $wgUser;
if ( $wgEmailConfirmToEdit && !$user->isEmailConfirmed() ) {