X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUserlogin.php;h=0410ef01f1f30f185d529c3495489b66fe959997;hb=440d21b0d9eed439507d1389a625a354d79cb17f;hp=0b500f4752b9d6c6e42b60771a094440a2d8a06a;hpb=4d0dd38e91d6a2308f41329bfd89fb0c186e5260;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 0b500f4752..0410ef01f1 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -559,7 +559,13 @@ class LoginForm extends SpecialPage { $u = User::newFromName( $this->mUsername, 'creatable' ); if ( !$u ) { return Status::newFatal( 'noname' ); - } elseif ( 0 != $u->idForName( User::READ_LOCKING ) ) { + } + + # Make sure the user does not exist already + $lock = $wgMemc->getScopedLock( wfGlobalCacheKey( 'account', md5( $this->mUsername ) ) ); + if ( !$lock ) { + return Status::newFatal( 'usernameinprogress' ); + } elseif ( $u->idForName( User::READ_LOCKING ) ) { return Status::newFatal( 'userexists' ); } @@ -939,8 +945,8 @@ class LoginForm extends SpecialPage { global $wgMemc, $wgLang, $wgSecureLogin, $wgPasswordAttemptThrottle, $wgInvalidPasswordReset; - $status = $this->authenticateUserData(); - switch ( $status ) { + $authRes = $this->authenticateUserData(); + switch ( $authRes ) { case self::SUCCESS: # We've verified now, update the real record $user = $this->getUser(); @@ -1066,8 +1072,8 @@ class LoginForm extends SpecialPage { LoggerFactory::getInstance( 'authmanager' )->info( 'Login attempt', array( 'event' => 'login', - 'successful' => $status === self::SUCCESS, - 'status' => LoginForm::$statusCodes[$status], + 'successful' => $authRes === self::SUCCESS, + 'status' => LoginForm::$statusCodes[$authRes], ) ); } @@ -1361,9 +1367,6 @@ class LoginForm extends SpecialPage { 'mediawiki.ui.input', 'mediawiki.special.userlogin.common.styles' ) ); - $out->addModules( array( - 'mediawiki.special.userlogin.common.js' - ) ); if ( $this->mType == 'signup' ) { // XXX hack pending RL or JS parse() support for complex content messages