summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblairski2013-02-08 06:48:08 (GMT)
committer blairski2013-02-08 06:48:08 (GMT)
commit650c1ba96e575e365e4252ecd9b7d0e902bf1314 (patch)
treec6840e7eacd39e7ece31857897da889f1437455d
parent0f7cd5968f43ad29f2ff92b4027ddab35f7de9ce (diff)
Get current users roles in welcome_get_message rather than welcome_user_login
-rw-r--r--welcome.admin.inc1
-rw-r--r--welcome.module7
2 files changed, 3 insertions, 5 deletions
diff --git a/welcome.admin.inc b/welcome.admin.inc
index 70f2814..d222525 100644
--- a/welcome.admin.inc
+++ b/welcome.admin.inc
@@ -69,7 +69,6 @@ function welcome_admin_settings($form) {
}
}
-
// Submit button
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
diff --git a/welcome.module b/welcome.module
index 148d716..7e77c79 100644
--- a/welcome.module
+++ b/welcome.module
@@ -24,8 +24,7 @@ function welcome_menu() {
* Implements hook_user_login().
*/
function welcome_user_login(&$edit, $account) {
- $roles = $account->roles;
- $message = welcome_get_message($roles, $account);
+ $message = welcome_get_message($account);
$message_replaced = token_replace($message, array('user' => $account));
drupal_set_message(t($message_replaced));
}
@@ -45,7 +44,7 @@ function welcome_theme() {
/**
* Get message for current user.
*/
-function welcome_get_message(array $roles, $account) {
+function welcome_get_message($account) {
$roles = $account->roles;
$rid = array_keys($roles);
@@ -70,4 +69,4 @@ function welcome_help($path, $arg) {
$output = '<p>' . t('<strong>Welcome message per role.</strong> Drag to order. If a user has more than one role, highest weighted role will be used.') . '</p>';
return $output;
}
-} \ No newline at end of file
+}