hi
thanks for a great module.
i need advice. i need users role to be changed on submission of a webform. i cant find a module that does that. rules module doesnt seem to allow either.
any quick advice?
thanks.

Comments

docwilmot’s picture

never mind. got it.

quicksketch’s picture

Status: Active » Fixed

If you can provide the solution that you found, that might help other users searching for the same solution.

docwilmot’s picture

you are quite correct.
added to "additional processing":

global $user; 
if (!in_array('THE_NEW_ROLE', $user->roles))
{
$roles = $user->roles;
$roles[THE_NEW_ROLEs_RID] = 'THE_NEW_ROLE';
$user = user_save($user, array('roles' => $roles));
}

i am no coder, so this may not be kosher, but works perfectly fine.

geoffs52’s picture

I've been looking around for an hour for this so thanks! I assume you swap out 'THE_NEW_ROLE' with the name of the role you want add?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.