e9e0b32b245025f23e359edd56b14c2395fcddd0
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / user_login.twig
1 /**
2  * Implements hook_user_login().
3  */
4 function {{ machine_name }}_user_login(UserInterface $account) {
5   $config = \Drupal::config('system.date');
6   // If the user has a NULL time zone, notify them to set a time zone.
7   if (!$account->getTimezone() && $config->get('timezone.user.configurable') && $config->get('timezone.user.warn')) {
8     \Drupal::messenger()
9       ->addStatus(t('Configure your <a href=":user-edit">account time zone setting</a>.', [
10         ':user-edit' => $account->url('edit-form', [
11           'query' => \Drupal::destination()
12             ->getAsArray(),
13           'fragment' => 'edit-timezone',
14         ]),
15       ]));
16   }
17 }