Merge "tests: Remove unused TableCleanupTest class"
[lhc/web/wiklou.git] / includes / specials / SpecialUserlogin.php
index 8864b98..38d3549 100644 (file)
@@ -567,7 +567,7 @@ class LoginForm extends SpecialPage {
 
                $cache = ObjectCache::getLocalClusterInstance();
                # Make sure the user does not exist already
-               $lock = $cache->getScopedLock( wfGlobalCacheKey( 'account', md5( $this->mUsername ) ) );
+               $lock = $cache->getScopedLock( $cache->makeGlobalKey( 'account', md5( $this->mUsername ) ) );
                if ( !$lock ) {
                        return Status::newFatal( 'usernameinprogress' );
                } elseif ( $u->idForName( User::READ_LOCKING ) ) {
@@ -636,7 +636,7 @@ class LoginForm extends SpecialPage {
                                $key = wfMemcKey( 'acctcreate', 'ip', $ip );
                                $value = $cache->get( $key );
                                if ( !$value ) {
-                                       $cache->set( $key, 0, 86400 );
+                                       $cache->set( $key, 0, $cache::TTL_DAY );
                                }
                                if ( $value >= $wgAccountCreationThrottle ) {
                                        return Status::newFatal( 'acct_creation_throttle_hit', $wgAccountCreationThrottle );
@@ -784,7 +784,7 @@ class LoginForm extends SpecialPage {
                // Give general extensions, such as a captcha, a chance to abort logins
                $abort = self::ABORTED;
                if ( !Hooks::run( 'AbortLogin', array( $u, $this->mPassword, &$abort, &$msg ) ) ) {
-                       if ( !in_array( $abort, self::$statusCodes, true ) ) {
+                       if ( !in_array( $abort, array_keys( self::$statusCodes ), true ) ) {
                                throw new Exception( 'Invalid status code returned from AbortLogin hook: ' . $abort );
                        }
                        $this->mAbortLoginErrorMsg = $msg;