(bug 2544) Illogical error reporting order in Special:Userlogin
authorRob Church <robchurch@users.mediawiki.org>
Tue, 4 Apr 2006 10:26:43 +0000 (10:26 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Tue, 4 Apr 2006 10:26:43 +0000 (10:26 +0000)
RELEASE-NOTES
includes/SpecialUserlogin.php

index 473d238..db56009 100644 (file)
@@ -425,6 +425,7 @@ Special Pages:
 * (bug 5372) Add number of files to Special:Statistics
 * (bug 2871) Links to talk pages in watchlist editing view
 * (bug 5385) Allow hiding anonymous edits on Special:Recentchanges
+* (bug 2544) Illogical error reporting order in Special:Userlogin
 
 Misc.:
 * PHP 4.1 compatibility fix: don't use new_link parameter to mysql_connect
index b6c7ef4..048fd2a 100644 (file)
@@ -185,6 +185,11 @@ class LoginForm {
                        }
                }
 
+               if ( wfReadOnly() ) {
+                       $wgOut->readOnlyPage();
+                       return false;
+               }
+
                if (!$wgUser->isAllowedToCreateAccount()) {
                        $this->userNotPrivilegedMessage();
                        return false;
@@ -198,12 +203,6 @@ class LoginForm {
                        return;
                }
 
-
-               if ( 0 != strcmp( $this->mPassword, $this->mRetype ) ) {
-                       $this->mainLoginForm( wfMsg( 'badretype' ) );
-                       return false;
-               }
-
                $name = trim( $this->mName );
                $u = User::newFromName( $name );
                if ( is_null( $u ) || $u->getName() = 'MediaWiki default' ) {
@@ -211,13 +210,13 @@ class LoginForm {
                        return false;
                }
 
-               if ( wfReadOnly() ) {
-                       $wgOut->readOnlyPage();
+               if ( 0 != $u->idForName() ) {
+                       $this->mainLoginForm( wfMsg( 'userexists' ) );
                        return false;
                }
 
-               if ( 0 != $u->idForName() ) {
-                       $this->mainLoginForm( wfMsg( 'userexists' ) );
+               if ( 0 != strcmp( $this->mPassword, $this->mRetype ) ) {
+                       $this->mainLoginForm( wfMsg( 'badretype' ) );
                        return false;
                }