Merge "Add semantic tags to license info text"
[lhc/web/wiklou.git] / includes / password / PasswordPolicyChecks.php
index d7aee5b..502f1e0 100644 (file)
@@ -20,7 +20,7 @@
  * @file
  */
 
-use \Cdb\Reader as CdbReader;
+use Cdb\Reader as CdbReader;
 
 /**
  * Functions to check passwords against a policy requirement
@@ -105,11 +105,15 @@ class PasswordPolicyChecks {
 
                $status = Status::newGood();
                $username = $user->getName();
-               if ( $policyVal
-                       && isset( $blockedLogins[$username] )
-                       && $password == $blockedLogins[$username]
-               ) {
-                       $status->error( 'password-login-forbidden' );
+               if ( $policyVal ) {
+                       if ( isset( $blockedLogins[$username] ) && $password == $blockedLogins[$username] ) {
+                               $status->error( 'password-login-forbidden' );
+                       }
+
+                       // Example from ApiChangeAuthenticationRequest
+                       if ( $password === 'ExamplePassword' ) {
+                               $status->error( 'password-login-forbidden' );
+                       }
                }
                return $status;
        }