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]);
}
Comments
Comment #1
cyberswat commentedHave you tried the dev version?
Comment #2
amitpatel049 commentedthanks 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...
Comment #3
ShadowAngel commentedNope, 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 =)
Comment #4
cyberswat commentedIt'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.
Comment #5
ck9 commentedThere 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.
Comment #6
cyberswat commented@ck9 care to write the simpletests?
Comment #7
ck9 commentedcyberswat, 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.
Comment #8
cyberswat commentedok ... marking this as fixed for now ... re-open if necessary.