Username.php 626 B

1234567891011121314151617181920
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * QuickForm rule to check if a username is of the correct format
  5. */
  6. class HTML_QuickForm_Rule_Username extends HTML_QuickForm_Rule
  7. {
  8. /**
  9. * Function to check if a username is of the correct format
  10. * @see HTML_QuickForm_Rule
  11. * @param string $username Wanted username
  12. * @return boolean True if username is of the correct format
  13. * @author Modified by Ivan Tcholakov, 15-SEP-2009. The validation rule is served by the UserManager class as of this moment.
  14. */
  15. function validate($username, $options)
  16. {
  17. return UserManager::is_username_valid($username);
  18. }
  19. }