Bug 1617: Incorrect login message when using AuthPlugin
authorJens Frank <jeluf@users.mediawiki.org>
Sun, 13 Mar 2005 17:49:28 +0000 (17:49 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Sun, 13 Mar 2005 17:49:28 +0000 (17:49 +0000)
includes/SpecialUserlogin.php

index 76db17b..1f9c1bc 100644 (file)
@@ -295,10 +295,13 @@ class LoginForm {
                         * automatically create a new account for users that
                         * are externally defined but have not yet logged in.
                         */
-                       if( $wgAuth->autoCreate() &&
-                           $wgAuth->userExists( $u->getName() ) &&
-                           $wgAuth->authenticate( $u->getName(), $this->mPassword ) ) {
-                           $u =& $this->initUser( $u );
+                       if ( $wgAuth->autoCreate() && $wgAuth->userExists( $u->getName() ) ) {
+                               if ( $wgAuth->authenticate( $u->getName(), $this->mPassword ) ) {
+                                       $u =& $this->initUser( $u );
+                               } else {
+                                       $this->mainLoginForm( wfMsg( 'wrongpassword' ) );
+                                       return;
+                               }
                        } else {
                                $this->mainLoginForm( wfMsg( 'nosuchuser', $u->getName() ) );
                                return;