Hi,
I have three roles, and i want two of them to be created only after admin approval.
Any suggestions how to do that?
Regards,
Rakesh Juneja

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jnettik’s picture

I could use this feature as well. The normal user/register form would have no approval but if someone is registering for one of the roles, that will need admin approval.

wizonesolutions’s picture

Version: 6.x-1.2 » 6.x-1.x-dev
Assigned: Unassigned » wizonesolutions

This was started for D7 at http://drupal.org/node/983612#comment-4005320, but it never made it in. Rather than trying to backport that, umm, lovely patch, I'm going to take a stab at cross-porting whatever Registration Role With Approval does. Wish me luck.

RKS’s picture

Why not use this module in conjunction with Apply for Role?

So you set your one auto role to autoassign, then set the other two roles for Apply for Role.

BTW, that issue has thousands of patches!

wizonesolutions’s picture

@RKS: Thanks for the module mention, but that one won't let me actually provide Content Profile fields (or really much of anything) during registration. That is a requirement of this client, and it doesn't seem like #318682: Provide form fields during the application process is coming along very well after 3 years.

I'll consider this as a backup thing to try fixing if my idea above (doing it how RRWA does it) turns out to be a wash.

RKS’s picture

Profile2
Profile2 Registration Paths

Check those two modules. Profile2 allows you to define fields for different registration forms.
Profile2 Registration Paths lets you define paths to different registration forms.

wizonesolutions’s picture

@RKS: This is a Drupal 6 issue and my comments are in the context of Drupal 6 :)

So unfortunately Profile2 won't help me. If I was running Drupal 7 I wouldn't have this problem to begin with because AAR 7.x already has this feature.

RKS’s picture

I haven't noticed this feature in AAR 7x yet, bu there is an active issue about it.

I didn't notice the 6x but can't your Content Profile module you mentioned do this? Profile2 mentions that Content Profile was the predecessor and that it is similar in nature.

What you're asking, registration forms, appears to be beyond the scope of this module. There are already other modules that handle registration forms and this module is designed to handle assigning roles automatically.

wizonesolutions’s picture

Err...@RKS have you used this module? "Assign from Path" is exactly for that purpose and already has Content Profile integration! So I'm just integrating the Drupal feature (more or less; I'm doing it based on Registration Role With Approval's code instead) where a user can be blocked by default depending on the role. We won't know if it's out of scope until I submit my patch! Then the community can decide. I have to do this anyway, so it's not super-important to me. But I like to contribute back when I add useful features. I've already got the option on the AAR settings form and just have to add some more code then will submit a patch.

hefox committed some patches from that issue so they are probably in 7.x-1.x-dev, but I don't know. I'm not on Drupal 7 so it's not that important to me.

wizonesolutions’s picture

Whoops, sorry, I made a mistake. #983612: 'Allow user to choose' functionality doesn't work doesn't have to do with this...it's more like duplicating RRWA's functionality :)

So what I'm doing is adding a setting to say which roles require approval. Then when a user uses that role's registration page they have to get approved if it's configured thus (aka they're blocked by default).

wizonesolutions’s picture

Status: Active » Needs review

And here we go! In my opinion, I've improved a bit on the way Registration Role With Approval does things. I borrowed some code from user.module so that any customization made to the pending approval template would carry over.

It's not perfect - I haven't tested it with users choosing their own roles and as such have included a note saying it only works with registration by path. That said, I think it does work when users choose their own roles as well because Auto Assign Role implements hook_user, $op = 'insert' to do its magic and my code runs after the user has been inserted into databases and compares the configuration against the user's existing roles.

I would love it if someone could review this and give me some feedback, and even improve it to make it more useful.

wizonesolutions’s picture

Whoops, gotta attach it!

Status: Needs review » Needs work

The last submitted patch, autoassignrole_1087464_approval_roles.patch, failed testing.

wizonesolutions’s picture

Status: Needs work » Needs review
FileSize
4.62 KB

Rolled in correct format.

leevh’s picture

Issue summary: View changes

5 years later, this patch still saved me! Thanks wizonesolutions!

wizonesolutions’s picture

:)