Skip to content

Commit

Permalink
Add user::valid_username() as a validation helper.
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat committed Apr 17, 2010
1 parent ca45341 commit 27b29af
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/user/helpers/user.php
Expand Up @@ -76,6 +76,12 @@ static function valid_password($password_input) {
}
}

static function valid_username($text_input) {
if (!self::lookup_by_name($text_input->value)) {
$text_input->add_error("invalid_username", 1);
}
}

/**
* Create the hashed passwords.
* @param string $password a plaintext password
Expand Down

0 comments on commit 27b29af

Please sign in to comment.