You are here

function hook_ldapauth_create in LDAP integration 6

hook_ldapauth_create

Ldapauth will invoke this after a new Drupal user has been created from the LDAP data and saved.

Parameters

User $account The user object for the new user.:

1 invocation of hook_ldapauth_create()
ldapauth_drupal_user_create in includes/ldap.core.inc
Create a new Drupal user from an LDAP user entry with checks to ensure that:

File

./ldapauth.api.php, line 16
LDAPAuth API function documentation

Code

function hook_ldapauth_create($account) {

  // Some example code to create an e-mail if ldap didn't provide one
  if ($account->name == $account->mail) {
    user_save($account, array(
      'mail' => $account->name . "@mydomain.com",
    ));
  }
}