function hook_user_login

The user just logged in.

Parameters

$account: The user object on which the operation was just performed.

Related topics

3 functions implement hook_user_login()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

session_test_user_login in drupal/core/modules/system/tests/modules/session_test/session_test.module
Implements hook_user_login().
system_user_login in drupal/core/modules/system/system.module
Implements hook_user_login().
user_user_login in drupal/core/modules/user/user.module
Implements hook_user_login().
1 invocation of hook_user_login()
user_login_finalize in drupal/core/modules/user/user.module
Finalize the login process. Must be called when logging in a user.

File

drupal/core/modules/user/user.api.php, line 286
Hooks provided by the User module.

Code

function hook_user_login($account) {
  $config = config('system.timezone');

  // If the user has a NULL time zone, notify them to set a time zone.
  if (!$account->timezone && $config
    ->get('user.configurable') && $config
    ->get('user.warn')) {
    drupal_set_message(t('Configure your <a href="@user-edit">account time zone setting</a>.', array(
      '@user-edit' => url("user/{$account->uid}/edit", array(
        'query' => drupal_get_destination(),
        'fragment' => 'edit-timezone',
      )),
    )));
  }
}