You are here

function hook_email_registration_name in Email Registration 7

Same name and namespace in other branches
  1. 8 email_registration.api.php \hook_email_registration_name()

Implement this hook to generate a username for email_registration module.

Other modules may implement hook_email_registration_name($edit, $account) to generate a username (return a string to be used as the username, NULL to have email_registration generate it).

Parameters

array $edit: The array of form values submitted by the user.

object $account: The user object on which the operation is being performed.

Return value

string A string defining a generated username.

1 invocation of hook_email_registration_name()
email_registration_user_insert in ./email_registration.module
Implements hook_user_insert().

File

./email_registration.api.php, line 28
Documentation for email_registration module API.

Code

function hook_email_registration_name($edit, $account) {

  // Your hook implementation should ensure that the resulting string
  // works as a username. You can use email_registration_cleanup_username($name)
  // to clean up the name.
  return email_registration_cleanup_username('u' . $account->uid);
}