You are here

class Username_Constraint in Password Policy 5

Hierarchy

Expanded class hierarchy of Username_Constraint

File

constraints/constraint_username.php, line 10

View source
class Username_Constraint extends Constraint {
  function validate($plaintext_password, $user = NULL) {
    return drupal_strtolower($user->name) != drupal_strtolower($plaintext_password);
  }
  function getDescription() {
    return t('Password must differ from the username. Put any positive number to enforce this policy.');
  }
  function getValidationErrorMessage() {
    return t('Password must differ from the username.');
  }
  function _charIsValid($character) {
    return TRUE;
  }

}

Members