Fix bug 11771: Signup form now not shown if in read-only mode.
authorChad Horohoe <demon@users.mediawiki.org>
Wed, 4 Jun 2008 21:33:01 +0000 (21:33 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Wed, 4 Jun 2008 21:33:01 +0000 (21:33 +0000)
RELEASE-NOTES
includes/SpecialUserlogin.php

index 4739e15..776f829 100644 (file)
@@ -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 ===
 
index 57737d4..f0bfff3 100644 (file)
@@ -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 ) {