You are here

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

Same name and namespace in other branches
  1. 8.2 ldap_test/LdapTestFunctions.class.php \LdapTestFunctions::userByNameFlushingCache()

File

ldap_test/LdapTestFunctions.class.php, line 187

Class

LdapTestFunctions

Code

public function userByNameFlushingCache($name) {
  $user = user_load_by_name($name);

  // Clear user cache.
  $users = user_load_multiple([
    $user->uid,
  ], [], TRUE);
  $user = $users[$user->uid];
  return $user;
}