I need to forward users with a specific role “roleA” after they login to the website.
I’ve tried to use
if ($form_id == ‘user_login’) {
global $user;
…
}
However this is before the user insert nickname and pass, therefore the role is always anonymous at this point.
What’s the form_id of the login submission form instead ? I would prefer to not install additional modules for this simple forwarding.
thanks
hook_user, $op = login.
But you can use just Rules module, there’s event – user login, filter for user role = “roleA”, action – redirect to page.