You are here

public function LdapTestFunctions::drupalLdapUpdateUser in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_test/LdapTestFunctions.class.php \LdapTestFunctions::drupalLdapUpdateUser()
  2. 7 ldap_servers/tests/LdapTestFunctions.class.php \LdapTestFunctions::drupalLdapUpdateUser()

File

ldap_test/LdapTestFunctions.class.php, line 148

Class

LdapTestFunctions

Code

public function drupalLdapUpdateUser($edit = [], $ldap_authenticated = FALSE, $user) {
  if (count($edit)) {
    $user = user_save($user, $edit);
  }
  if ($ldap_authenticated) {
    user_set_authmaps($user, [
      'authname_ldap_user' => $user->name,
    ]);
  }
  return $user;
}