You are here

function event_user in Event 5.2

Implementation of hook_user.

Related topics

File

./event.module, line 172

Code

function event_user($type, &$edit, &$user) {
  if ($type == 'login') {
    if (!$user->timezone_id) {

      // Lookup TZ ID based on TZ offset
      $timezone_id = event_timezone_map($user->timezone);

      // Update all users with the same offset.
      db_query('UPDATE {users} SET timezone_id = %d WHERE timezone = %d AND timezone_id = 0', $timezone_id, $user->timezone);
    }
  }
}