You are here

function restrict_by_ip_user_delete in Restrict Login or Role Access by IP Address 8.4

Same name and namespace in other branches
  1. 7.3 restrict_by_ip.module \restrict_by_ip_user_delete()

Implements hook_user_delete().

File

./restrict_by_ip.module, line 57
Restrict logins or roles to whitelisted IP addresses.

Code

function restrict_by_ip_user_delete($account) {
  if ($account
    ->isAuthenticated()) {
    $config = \Drupal::service('config.factory')
      ->getEditable('restrict_by_ip.settings');
    $config
      ->clear('user.' . $account
      ->id())
      ->save();
  }
}