You are here

function simple_ldap_user_update_authmap in Simple LDAP 7.2

2 calls to simple_ldap_user_update_authmap()
simple_ldap_user_export_user in simple_ldap_user/simple_ldap_user.module
Batch process function for mass user export. &$context comes from batch_set().
simple_ldap_user_user_insert in simple_ldap_user/simple_ldap_user.module
Implements hook_user_insert().

File

simple_ldap_user/simple_ldap_user.module, line 322
Main simple_ldap_user module file.

Code

function simple_ldap_user_update_authmap($account, $ldap_user = NULL) {

  // Write out the PUID or the DN to the authmap
  if (!$ldap_user) {
    $ldap_user = SimpleLdapUser::singleton($account->name);
  }
  $puid_attr = strtolower(simple_ldap_user_variable_get('simple_ldap_user_unique_attribute'));
  $puid_attr = $puid_attr ? $puid_attr : 'dn';
  user_set_authmaps($account, array(
    'authmap_simple_ldap' => $ldap_user->{$puid_attr}[0],
  ));
}