You are here

function simple_ldap_user_user_login in Simple LDAP 7.2

Same name and namespace in other branches
  1. 7 simple_ldap_user/simple_ldap_user.module \simple_ldap_user_user_login()

Implements hook_user_login().

Fires when a user logs in.

Parameters

array $edit: The form values submitted by the user to log in, including raw username and password.

File

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

Code

function simple_ldap_user_user_login(&$edit, $account) {
  if (property_exists($account, 'uid') && $account->uid == 1) {
    return;
  }
  $sync = simple_ldap_user_variable_get('simple_ldap_user_sync');
  if ($sync == 'hook_user_login') {
    switch (simple_ldap_user_variable_get('simple_ldap_user_source')) {
      case 'ldap':
        simple_ldap_user_sync_user_to_drupal($account);
        break;
      case 'drupal':
        simple_ldap_user_sync_user_to_ldap($account);
        break;
    }
  }
}