You are here

function timezone_detect_user_login in Timezone Detect 7

Same name and namespace in other branches
  1. 8 timezone_detect.module \timezone_detect_user_login()

Implements hook_user_login().

File

./timezone_detect.module, line 63
Module provides automatic timezone detection via javascript.

Code

function timezone_detect_user_login(&$edit, $account) {
  if (variable_get('timezone_detect_mode') === TIMEZONE_DETECT_MODE_LOGIN || empty($account->timezone)) {

    // Set session flag to update user's timezone. Note that we cannot add the
    // js directly from this function, as the user is redirected after this
    // hook fires.
    $_SESSION['timezone_detect']['update_timezone'] = TRUE;
  }
}