* (bug 9472) Invalid XHTML on cached special pages
* (bug 9472) Invalid XHTML on Special:Newpages
* (bug 4764) "My contributions" not bold when viewing own contributions
-* (bug 9194) Add {{PLURAL:...}} to navigation bar of special:whatlinkshere
+* (bug 9194) Add {{PLURAL:...}} to navigation bar of Special:Whatlinkshere
+* (bug 9033) Use a more specific error message when users are not able/allowed
+ to edit page protection levels due to a block, database lock or permissions
== Maintenance ==
* New script maintenance/language/checkExtensioni18n.php used to check i18n
}
function show( $err = null ) {
- global $wgOut;
+ global $wgOut, $wgUser;
$wgOut->setRobotpolicy( 'noindex,nofollow' );
$wgOut->setPageTitle( wfMsg( 'confirmprotect' ) );
$wgOut->setSubtitle( wfMsg( 'protectsub', $this->mTitle->getPrefixedText() ) );
- $wgOut->addWikiText(
- wfMsg( $this->disabled ? "protect-viewtext" : "protect-text",
- wfEscapeWikiText( $this->mTitle->getPrefixedText() ) ) );
+ # Show an appropriate message if the user isn't allowed or able to change
+ # the protection settings at this time
+ if( $this->disabled ) {
+ if( $wgUser->isAllowed( 'protect' ) ) {
+ if( $wgUser->isBlocked() ) {
+ # Blocked
+ $message = 'protect-locked-blocked';
+ } else {
+ # Database lock
+ $message = 'protect-locked-dblock';
+ }
+ } else {
+ # Permission error
+ $message = 'protect-locked-access';
+ }
+ } else {
+ $message = 'protect-text';
+ }
+ $wgOut->addWikiText( wfMsg( $message, wfEscapeWikiText( $this->mTitle->getPrefixedText() ) ) );
$wgOut->addHTML( $this->buildForm() );
'unprotectcomment' => 'Reason for unprotecting',
'protect-unchain' => 'Unlock move permissions',
'protect-text' => 'You may view and change the protection level here for the page <strong>$1</strong>.',
-'protect-viewtext' => 'Your account does not have permission to change
-page protection levels. Here are the current settings for the page <strong>$1</strong>:',
+'protect-locked-blocked' => 'You cannot change protection levels while blocked. Here are the
+current settings for the page <strong>$1</strong>:',
+'protect-locked-dblock' => 'Protection levels cannot be changed due to an active database lock.
+Here are the current settings for the page <strong>$1</strong>:',
+'protect-locked-access' => 'Your account does not have permission to change page protection levels.
+Here are the current settings for the page <strong>$1</strong>:',
'protect-cascadeon' => "This page is currently protected because it is included in the following pages, which have cascading protection turned on. You can change this page's protection level, but it will not affect the cascading protection.",
'protect-default' => '(default)',
'protect-level-autoconfirmed' => 'Block unregistered users',
'unprotectcomment',
'protect-unchain',
'protect-text',
- 'protect-viewtext',
+ 'protect-locked-blocked',
+ 'protect-locked-dblock',
+ 'protect-locked-access',
'protect-cascadeon',
'protect-default',
'protect-level-autoconfirmed',