Index: trunk/phase3/includes/specials/SpecialUserlogin.php |
— | — | @@ -417,12 +417,6 @@ |
418 | 418 | return self::THROTTLED; |
419 | 419 | } |
420 | 420 | } |
421 | | - // If we've enabled it, make it so that a blocked user cannot login |
422 | | - global $wgBlockDisablesLogin; |
423 | | - $u = User::newFromName( $this->mName ); |
424 | | - if( $wgBlockDisablesLogin && !is_null( $u ) && $u->isBlocked() ) { |
425 | | - return self::USER_BLOCKED; |
426 | | - } |
427 | 421 | |
428 | 422 | // Load $wgUser now, and check to see if we're logging in as the same |
429 | 423 | // name. This is necessary because loading $wgUser (say by calling |
— | — | @@ -439,6 +433,7 @@ |
440 | 434 | |
441 | 435 | # TODO: Allow some magic here for invalid external names, e.g., let the |
442 | 436 | # user choose a different wiki name. |
| 437 | + $u = User::newFromName( $this->mName ); |
443 | 438 | if( is_null( $u ) || !User::isUsableName( $u->getName() ) ) { |
444 | 439 | return self::ILLEGAL; |
445 | 440 | } |
— | — | @@ -470,6 +465,7 @@ |
471 | 466 | return $abort; |
472 | 467 | } |
473 | 468 | |
| 469 | + global $wgBlockDisablesLogin; |
474 | 470 | if (!$u->checkPassword( $this->mPassword )) { |
475 | 471 | if( $u->checkTemporaryPassword( $this->mPassword ) ) { |
476 | 472 | // The e-mailed temporary password should not be used for actu- |
— | — | @@ -500,6 +496,9 @@ |
501 | 497 | } else { |
502 | 498 | $retval = ($this->mPassword == '') ? self::EMPTY_PASS : self::WRONG_PASS; |
503 | 499 | } |
| 500 | + } elseif ( $wgBlockDisablesLogin && $u->isBlocked() ) { |
| 501 | + // If we've enabled it, make it so that a blocked user cannot login |
| 502 | + $retval = self::USER_BLOCKED; |
504 | 503 | } else { |
505 | 504 | $wgAuth->updateUser( $u ); |
506 | 505 | $wgUser = $u; |