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
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

cyberswat - June 13, 2009 - 03:55

Have you tried the dev version?

#2

amitpatel049 - June 13, 2009 - 14:11

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

ShadowAngel - June 14, 2009 - 09:08

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

cyberswat - June 14, 2009 - 12:15

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

ck9 - June 18, 2009 - 02:57

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

cyberswat - June 24, 2009 - 16:31
Status:patch (to be ported)» needs work

@ck9 care to write the simpletests?

#7

ck9 - June 24, 2009 - 23:58

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

cyberswat - June 29, 2009 - 14:03
Status:needs work» fixed

ok ... marking this as fixed for now ... re-open if necessary.

#9

System Message - July 13, 2009 - 14:10
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.