Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#13 | autoassignrole_1087464_approval_roles_p1.patch | 4.62 KB | wizonesolutions |
#11 | autoassignrole_1087464_approval_roles.patch | 4.7 KB | wizonesolutions |
Comments
Comment #1
jnettikI 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.
Comment #2
wizonesolutionsThis 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.
Comment #3
RKS CreditAttribution: RKS commentedWhy 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!
Comment #4
wizonesolutions@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.
Comment #5
RKS CreditAttribution: RKS commentedProfile2
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.
Comment #6
wizonesolutions@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.
Comment #7
RKS CreditAttribution: RKS commentedI 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.
Comment #8
wizonesolutionsErr...@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.
Comment #9
wizonesolutionsWhoops, 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).
Comment #10
wizonesolutionsAnd 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.
Comment #11
wizonesolutionsWhoops, gotta attach it!
Comment #13
wizonesolutionsRolled in correct format.
Comment #14
leevh CreditAttribution: leevh commented5 years later, this patch still saved me! Thanks wizonesolutions!
Comment #15
wizonesolutions:)