email_registration.api.php 978 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * @file
  4. * Documentation for email_registration module API.
  5. */
  6. /**
  7. * @addtogroup hooks
  8. * @{
  9. */
  10. /**
  11. * Implement this hook to generate a username for email_registration module.
  12. *
  13. * Other modules may implement hook_email_registration_name($edit, $account)
  14. * to generate a username (return a string to be used as the username, NULL
  15. * to have email_registration generate it).
  16. *
  17. * @param array $edit
  18. * The array of form values submitted by the user.
  19. * @param object $account
  20. * The user object on which the operation is being performed.
  21. *
  22. * @return string
  23. * A string defining a generated username.
  24. */
  25. function hook_email_registration_name($edit, $account) {
  26. // Your hook implementation should ensure that the resulting string
  27. // works as a username. You can use email_registration_cleanup_username($name)
  28. // to clean up the name.
  29. return email_registration_cleanup_username('u' . $account->uid);
  30. }
  31. /**
  32. * @} End of "addtogroup hooks".
  33. */