It would be nice to have an option
where users are autoapproved as soon as they apply
or at least be approved when system (or admin)
approves them

Comments

heather’s picture

I think this module, Apply for Role, is specifically for managed approvals. There's another module called "auto assign role" which does what you suggest, and would suit your needs: http://drupal.org/project/autoassignrole "This module automatically assigns new users to a specific role when the user initially signs up for their account."

drewish’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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

Flying Drupalist’s picture

Version: 5.x-1.x-dev »
Status: Closed (fixed) » Active

Hi, may I second this request for 6.x?

I want my users to start out as default, but be able to move up to higher roles if they want to. This will open up 'advanced' settings for them, I don't want this to be moderated but auto approved. Thanks!

maindrain’s picture

I would like an auto-approve option also.

restyler’s picture

any news on this very useful feature? autoassign role doesn't help in some cases.

Gabriel R.’s picture

It sounds like a useful action to have for a role application.

moonleaf’s picture

Version: » 6.x-1.9

I'd like to request this feature as well

thurain’s picture

me too, I need this feature. I tried Auto Assign Role module but it is not working prefectly.
I would like user to choose role during their account registration and depend on their role, they will allow to view certain Webpages and some webpages are disable for them.

I think it would be nice to have auto approve function in this module

j0rd’s picture

AutoAssignRole does not work like apply_for_role does, since it does not deal with already active users and only new ones.

I've been attempting to create an automatic approval via the hook_apply_for_role($action == 'apply') and then calling apply_for_role_approve_apply(), but because of the recursive nature of this and how the hooks are laid out, theres a final save function which eventually nullifies any roles, which get added.

I've managed to do it with a cron hook which isn't ideal, but works well enough for me.

function cwg_affiliate_cron() {
  $result = db_query("SELECT * FROM {users_roles_apply} WHERE approve_date=0 AND approved=0");
  while($record = db_fetch_object($result)) {
    $account = user_load($record->uid);
    apply_for_role_approve_apply($account, $record->rid);
  }
}

If you only wanted to do it for certain roles, you could add another WHERE over the `rid` field.

virtualdrupal’s picture

You could also use a Hook user insert for D7

/**
* Implementation of hook_user_insert() for automatically approving applications
*/
function modulename_user_insert(&$edit, $account, $category) {
        // I manually set my $rid to 8, so you'll need to change that
	apply_for_role_approve_apply($account, 8);
}
falent’s picture

hi, where should I copy this code? I need something like this that user can choose a role after registration but I don't want to approve it. It should be approved automatically :)

jnicola’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

No longer supporting 6.x issues