You are here

function ldap_servers_user_logout in Lightweight Directory Access Protocol (LDAP) 8.4

Same name and namespace in other branches
  1. 8.3 ldap_servers/ldap_servers.module \ldap_servers_user_logout()

Implements hook_user_logout().

File

ldap_servers/ldap_servers.module, line 31

Code

function ldap_servers_user_logout($account) {

  // When the user logs out clear the LDAP cached data.

  /** @var \Drupal\Core\Session\AccountInterface $account */
  $cache_key = 'ldap_servers:user_data:' . $account
    ->getAccountName();
  if (\Drupal::cache()
    ->get($cache_key)) {
    \Drupal::cache()
      ->delete($cache_key);
  }
}