hook_user_login

hook_user_login($account)

The user just logged in.

Parameters

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

Related topics

Hooks
Define functions that alter the behavior of Drupal core.

File

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

Code

function hook_user_login($account) {
  $config = \Drupal::config('system.date');
  // If the user has a NULL time zone, notify them to set a time zone.
  if (!$account->getTimezone() && $config->get('timezone.user.configurable') && $config->get('timezone.user.warn')) {
    drupal_set_message(t('Configure your <a href=":user-edit">account time zone setting</a>.', array(':user-edit' => $account->url('edit-form', array('query' => \Drupal::destination()->getAsArray(), 'fragment' => 'edit-timezone')))));
  }
}
doc_Drupal
2016-10-29 09:18:37
Comments
Leave a Comment

Please login to continue.