r63978 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63977‎ | r63978 | r63979 >
Date:14:44, 20 March 2010
Author:platonides
Status:ok
Tags:
Comment:
Show an appropiate message when the wiki is read only for some special pages.
Note that they show a successful message but wouldn't work since User::saveSettings()
silently fails (maybe the user object at memcached could get updated?).
Modified paths:
  • /trunk/phase3/includes/specials/SpecialConfirmemail.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialMergeHistory.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialResetpass.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialConfirmemail.php
@@ -25,6 +25,12 @@
2626 function execute( $code ) {
2727 global $wgUser, $wgOut;
2828 $this->setHeaders();
 29+
 30+ if ( wfReadOnly() ) {
 31+ $wgOut->readOnlyPage();
 32+ return;
 33+ }
 34+
2935 if( empty( $code ) ) {
3036 if( $wgUser->isLoggedIn() ) {
3137 if( User::isValidEmailAddr( $wgUser->getEmail() ) ) {
@@ -121,6 +127,12 @@
122128
123129 function execute( $code ) {
124130 $this->setHeaders();
 131+
 132+ if ( wfReadOnly() ) {
 133+ $wgOut->readOnlyPage();
 134+ return;
 135+ }
 136+
125137 $this->attemptInvalidate( $code );
126138 }
127139
Index: trunk/phase3/includes/specials/SpecialResetpass.php
@@ -19,6 +19,11 @@
2020 function execute( $par ) {
2121 global $wgUser, $wgAuth, $wgOut, $wgRequest;
2222
 23+ if ( wfReadOnly() ) {
 24+ $wgOut->readOnlyPage();
 25+ return;
 26+ }
 27+
2328 $this->mUserName = $wgRequest->getVal( 'wpName' );
2429 $this->mOldpass = $wgRequest->getVal( 'wpPassword' );
2530 $this->mNewpass = $wgRequest->getVal( 'wpNewPassword' );
Index: trunk/phase3/includes/specials/SpecialMergeHistory.php
@@ -54,6 +54,11 @@
5555 function execute( $par ) {
5656 global $wgOut, $wgRequest, $wgUser;
5757
 58+ if ( wfReadOnly() ) {
 59+ $wgOut->readOnlyPage();
 60+ return;
 61+ }
 62+
5863 if( !$this->userCanExecute( $wgUser ) ) {
5964 $this->displayRestrictionError();
6065 return;

Status & tagging log