Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / user_login.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_login.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/user_login.twig
new file mode 100644 (file)
index 0000000..c4879e9
--- /dev/null
@@ -0,0 +1,9 @@
+/**
+ * Implements hook_user_login().
+ */
+function {{ machine_name }}_user_login(&$edit, $account) {
+  // If the user has a NULL time zone, notify them to set a time zone.
+  if (!$account->timezone && variable_get('configurable_timezones', 1) && variable_get('empty_timezone_message', 0)) {
+    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')))));
+  }
+}