You are here

function timezone_detect_user in Timezone Detect 6

Implements hook_user().

File

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

Code

function timezone_detect_user($op, &$edit, &$account, $category = NULL) {
  switch ($op) {
    case 'login':
      if (variable_get('timezone_detect_mode', TIMEZONE_DETECT_MODE_DEFAULT) === 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;
      }
      break;
  }
}