All created roles show in the registration page
ShadowAngel - June 13, 2009 - 03:53
| Project: | Auto Assign Role |
| Version: | 6.x-1.0-beta3 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | ShadowAngel |
| Status: | closed |
Jump to:
Description
While trying out the module I found out that all the roles I've created were being shown in the registration page.
To fix the problem this is what I did:
I replaced the following code
if (!in_array($k, $user_roles)) {
unset($roles[$k]);
}
with
//Check to see if the configured user role is in the system
foreach ($roles as $k => $r) {
$inArray = false;
foreach($user_roles as $key) {
if($user_roles[$key]==$k) {
$inArray = true;
}
}
//if the role is not configured to be displayed then
//remove it from the roles array
if(!$inArray)
unset($roles[$k]);
}

#1
Have you tried the dev version?
#2
thanks man ....
i was facing same problem....
it should be updated in next version otherwise there is no meaning of
giving admin to choose which user role to display on signups...
#3
Nope, haven't tried the dev version yet. . . I was under the assumption that it was better to use the beta rather than the dev versions =P
Will try to use the dev versions next time I encounter problems of a module, Thanks =)
#4
It's hit or miss ... we've been working on the dev version quite a bit and have a lot of bug fixes in place. There will be a new beta or release candidate coming very soon but as of now, the best version is likely the dev version.
#5
There needs to be double, triple, quadruple checks to make sure this doesn't happen. I near about had a heart attack when I realised the users were being presented with the option to sign up as 'SuperUser' although only 'employee' and 'employer' was allowed.
#6
@ck9 care to write the simpletests?
#7
cyberswat, I installed the latest dev version and so far so good. Very happy with the register by path feature too and seems the bug was fixed. The earlier comment was in reference to 6.x-1.0-beta3.
#8
ok ... marking this as fixed for now ... re-open if necessary.
#9
Automatically closed -- issue fixed for 2 weeks with no activity.