Hello again
I've installed the user-selectable role module and login destination module, however, how can I make a user with a specific role redirect to a specific page when he/she enters his username and password to login?
I created a role web-client for those specific users, and have admin also as user, but not defined as role.

Comments

mrtoner’s picture

Questions like this are best asked in the relevant module support queue. That's said, you'll want to tailor this to meet your needs for Login Destination:

global $user;
if ($user->uid == 1){
   return 'admin';
}
elseif (in_array('thisrole',$user->roles)) {
   return 'here');
}
else {
   return 'home';
}
lordrt21’s picture

thanks, but where to put this code? Login destination has 2 textareas, one for redirect condition and one for the URL to redirect, or should I modify a php file in the module itself?

mrtoner’s picture

That's the URL destination. The condition is Always. Most projects I use Rules, but LD offers greater flexibility if you need it.

luyendao’s picture

You can either write your own module to do this, and use the your_module_name_form_alter() hook, or take a look at the Rules module, it's very comprehensive and will give you the control you need.

lordrt21’s picture

thanks Rules did the trick