You are here

function simple_ldap_user_user_load in Simple LDAP 7

Same name and namespace in other branches
  1. 7.2 simple_ldap_user/simple_ldap_user.module \simple_ldap_user_user_load()

Implements hook_user_load().

Fires when user information is being loaded from the database. User information is cached, so this does not fire every time a user object is handled.

File

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

Code

function simple_ldap_user_user_load($users) {
  $sync = simple_ldap_user_variable_get('simple_ldap_user_sync');
  if ($sync == 'hook_user_load') {
    foreach ($users as $account) {
      if ($account->uid == 1) {
        continue;
      }
      simple_ldap_user_sync_user($account);
    }
  }
}