If a user signs up and doesn't select a role, can they go back into their account and select the role? I don't see that option in the users Account settings.

Comments

mp’s picture

i would need this too ... i think this could be very usefull.
can you add a checkbox in the module where you can activate if users can change their roles or not? that would be great!
i would need it for D6

greets

mp’s picture

i found a solution for that if someone is interested in it ... for D6

greets

billnbell’s picture

Post it

RicardoJBarrios’s picture

Version: 5.x-1.2 » 6.x-1.x-dev

Yes, I'm also looking for it. Please, post.

mp’s picture

hi

just delete or comment out the lines marked with "modified by gr4phic3r" in autoassignrole.module

/**
 * Implementation of hook_user().
 */
function autoassignrole_user($op, &$edit, &$account, $category = NULL) {
  switch ($op) {
    case 'insert':
	case 'update':
/* modified by gr4phic3r
      if (_autoassignrole_settings('user_active') == 1) {
*/
        $roles = array();
        $user_roles = _autoassignrole_settings('user_roles');
        if(is_array($edit['user_roles'])) {
          foreach ($edit['user_roles'] as $k => $v) {
            if ($v != 0 && in_array($k, $user_roles)) {
              $roles[$k] = $v;
            }
          }
          $edit['roles'] = $roles;
        }
/* modified by gr4phic3r
        elseif($edit['user_roles'] != '') {
          $edit['roles'] = array($edit['user_roles'] => $edit['user_roles']);
        }
      }
*/
      if (_autoassignrole_settings('auto_active') == 1) {
        $auto_roles = _autoassignrole_settings('auto_roles');
        foreach($auto_roles as $k => $v) {
          $edit['roles'][$k] = $v;
        }
      }
      $account = user_load(array("uid"=>$account->uid));
    break;

greets

RicardoJBarrios’s picture

Category: support » feature
Status: Active » Patch (to be ported)

A lot of thanks... I've marked it as a patch to see if it can be done in next version.

cyberswat’s picture

Status: Patch (to be ported) » Needs work

Please roll this as a real patch http://drupal.org/patch/create

manoloka’s picture

Wouldn't be easier just mark it as "Required" than patching the module?

This way if someone submits without choosing a role they'll get a "field is required" message.

Just my thoughts

gmclelland’s picture

What is the status on this?

This should definitely be an option included, but maybe it should use the variables that is under the "Allow user to choose" fieldset on the AutomaticAssignRoles settings page.

cyberswat’s picture

Still looking for a decent patch for this.

billnbell’s picture

It appears this is in the beta 3...

I think the "case 'update':" is missing too.

junro’s picture

subscribe,

Do this pach is in the last dev version of July? I can't find how to allow users to change their roles.

cyberswat’s picture

Status: Needs work » Closed (won't fix)

This would only work if the user is allowed to make the selection during registration. It looses viability when a user is presented with multiple paths or content types that can function as a registration form. Each path might present a node with specific cck fields that are required. Simply providing a mechanism for the user to switch their role would not account for all of the possible variations. I'm not entirely convinced this is something I am going to be able to provide.

I am going to mark this as won't fix unless a decent patch is provided that can be prooven through simpletest

junro’s picture

@cyberswat

"This would only work if the user is allowed to make the selection during registration." It's what I need! :)

junro’s picture

Status: Closed (won't fix) » Active

Hello, Users can choose a role on registration page but can't change their role after... It doesn't make sense.

My users HAVE to choose a role (only one) on registration page but they could change it later...

This feature is impossible?

13rac1’s picture

Status: Active » Closed (won't fix)

@juno it's not impossible. I'm sure cyberswat would accept a patch for this functionality.

Have you looked at http://drupal.org/project/role_control?

Setting back to won't fix since cyberswat's reasoning still applies.

junro’s picture

@control

I didn't take a look on this module. i would say: Again a module not maintained...
I'm not a developper it's not safe for me to use it....
The problem with Drupal is that a lot of modules have to be maintain to avoid problems.

13rac1’s picture

It's not unsafe per se. Unless there are outstanding security bugs listed, it is just a matter of it working correctly. Try it and test everything. If it works correctly for your needs, then there isn't an important reason you can't use it.

izahn’s picture

I really want this functionality. With the current system a user has only one shot to choose the appropriate role. If they screw up and choose the wrong one their stuck with it unless they contact the admin and request a change. I really want users to be able to change their role after the fact. Maybe I'm doing something wrong, but commenting out parts of the code as suggested n #5 did not seem to achieve this.

I don't have the chops to program this myself, but I'm willing to contribute $50 USD towards seeing this implemented.

-Ista

hellomobe’s picture

+1 - if a user didn't select a role in the registration (other than by default authenticated), then they should be able to edit/choose their role later under the user profile edit. In my case, as may be for many others, the different cck field/path issues (which is a very valid point) only comes up for defined roles.

cyberswat’s picture

I agree this is useful functionality and would gladly accept a patch.

drupdruppalpal’s picture

I think it could be done with a Triggered rule (with rules module), and a selection cck field at content profile.
if cck field is selected, and User profile (with content profile) updated, => add role X to the user

is a dirty solution, and it would be better if this is done at edit user configuration instead of the user profile configuration.

:P

junro’s picture

Status: Closed (won't fix) » Active

Nobody doesn"t have a patch for this functionnality?

Or maybe you have find another solution?

miaoulafrite’s picture

Version: 6.x-1.x-dev » 6.x-1.2

subscribing.
i'm using module ver. 1.2 and this functionality is still not implemented apparently.

echelon89’s picture

+1

YK85’s picture

subscribe

boreg’s picture

You can still use http://drupal.org/project/user_selectable_roles. I just tested it and it works like a charm. Not as many features like auto assign, but it's enough if you want just select roles A) during registration B) during registration + change it in user's profile

junro’s picture

Oh didn't knew this module. Looks like to do the job! Thanks :)

jpmizell’s picture

User-Selectable Roles does provide the ability for in-profile user role selection. However, it still presents the choice on the registration form which is a feature I don't want. Sadly, for those of us in D6, it is defaulting to Auto Assign Role for D7 and is under minimal maintenance.

kenorb’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.