From e4f94326a75bbac85850c8852f5ef99a31377493 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Wed, 4 Jun 2008 21:33:01 +0000 Subject: [PATCH] Fix bug 11771: Signup form now not shown if in read-only mode. --- RELEASE-NOTES | 2 +- includes/SpecialUserlogin.php | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4739e15d1e..776f82934c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -333,7 +333,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 14367) Failed block no longer adds phantom watchlist entry * (bug 14385) "Move subpages" option no longer tries to move to invalid titles * (bug 14386) Fix subpage namespace oddity when moving a talk page - +* (bug 11771) Signup form now not shown if in read-only mode. === API changes in 1.13 === diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index 57737d4da2..f0bfff3439 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -716,9 +716,15 @@ class LoginForm { global $wgAuth, $wgEmailConfirmToEdit; $titleObj = SpecialPage::getTitleFor( 'Userlogin' ); - + if ( $this->mType == 'signup' ) { - if ( $wgUser->isBlockedFromCreateAccount() ) { + // Block signup here if in readonly. Keeps user from + // going through the process (filling out data, etc) + // and being informed later. + if ( wfReadOnly() ) { + $wgOut->readOnlyPage(); + return; + } elseif ( $wgUser->isBlockedFromCreateAccount() ) { $this->userBlockedMessage(); return; } elseif ( count( $permErrors = $titleObj->getUserPermissionsErrors( 'createaccount', $wgUser, true ) )>0 ) { -- 2.20.1