You are here

function system_user_login in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/system.module \system_user_login()

Implements hook_user_login().

File

core/modules/system/system.module, line 756
Configuration system that lets administrators modify the workings of the site.

Code

function system_user_login(UserInterface $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',
      )),
    )));
  }
}