From: Rob Church Date: Tue, 4 Apr 2006 10:26:43 +0000 (+0000) Subject: (bug 2544) Illogical error reporting order in Special:Userlogin X-Git-Tag: 1.6.0~29 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=9afb194514d065441d1e1a97dd48d951884601e3;p=lhc%2Fweb%2Fwiklou.git (bug 2544) Illogical error reporting order in Special:Userlogin --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 473d2386dc..db560094dc 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 diff --git a/includes/SpecialUserlogin.php b/includes/SpecialUserlogin.php index b6c7ef498d..048fd2a5b6 100644 --- a/includes/SpecialUserlogin.php +++ b/includes/SpecialUserlogin.php @@ -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; }