代码

Drupal8 判断用户首次登录

admin 提交于 周一, 10/09/2017 - 17:40
/**
 * Implements hook_user_login().
 */
function mymodlue_user_login($account) {
    drupal_set_message(t('成功登录'));
    $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>.', [':user-edit' => $account->url('edit-form', ['query' => \Drupal::d

标签