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.
An administrator is able specify multiple registration paths, and configure each one for specific auto role assignment settings.
Example:
/user/register/trial ('trial' role assigned)
/user/register/poweruser ('member' and 'power user' roles assigned)
/somepath/signup ('member' role assigned)
Comment | File | Size | Author |
---|---|---|---|
#62 | autoassignrole-971320-62.patch | 22.1 KB | mike.davis |
#61 | autoassignrole-971320-61.patch | 22.86 KB | mike.davis |
#60 | autoassignrole-971320-60.patch | 19.48 KB | mike.davis |
#59 | autoassignrole.zip | 19.43 KB | Anonymous (not verified) |
#45 | configurableregpaths-971320-44.patch | 18.4 KB | tigerfinch |
Comments
Comment #1
cyberswat CreditAttribution: cyberswat commentedI think that for the d7 version it makes a lot of sense to turn the paths that aar looks at into tokens. I'm trying to envision what this functionality should look like. I think the integration with Content Profile has been good for the d6 version but that approach can be greatly improved in the d7 version.
Comment #2
mrfelton CreditAttribution: mrfelton commentedI'm not sure I know what you mean by turning paths that aar looks at into tokens...?
Comment #3
cyberswat CreditAttribution: cyberswat commentedTake a look at http://drupal.org/project/token and http://drupal.org/project/pathauto ... Here's an issue that begins to outline a use case #927076: autoassignrole by path tokens ... it's a little incorrect to say turn the paths into tokens. A clearer way of saying that is to allow AAR to use tokens to define paths that would be assigned role(s).
Comment #4
mrfelton CreditAttribution: mrfelton commentedRight, but I don't see that as an essential part of this feature request. Maybe a nice addition, but should probably belong in another ticket.
For this request, we simply need to be able to create any number of paths, each of which will have a user registration form, and automatically assigned roles based on the config of the path in the admin interface.
Comment #5
cyberswat CreditAttribution: cyberswat commentedOk ... I understand your point now. Thanks for entering this use case ... I'm looking to get it in place relatively quickly and have added it to the release plan on the project page.
Comment #6
vantuykom CreditAttribution: vantuykom commentedI don't see any possibility to set the paths. Do I need an extra module for this function?
Comment #7
TripX CreditAttribution: TripX commentedSubscribe
Sadly there is no possibility to set paths.
Comment #8
ebeyrent CreditAttribution: ebeyrent commented+1
Comment #9
felipepodesta CreditAttribution: felipepodesta commented+1
Subs
Comment #10
vasna sdoeung CreditAttribution: vasna sdoeung commentedsub
Comment #11
theullrich CreditAttribution: theullrich commentedsub
Comment #12
andrenoronha CreditAttribution: andrenoronha commentedsubscribe!
Comment #13
jayco33 CreditAttribution: jayco33 commentedsubscribe
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous commentedsubscribe
Comment #15
modstore CreditAttribution: modstore commentedsubscribe
Comment #16
juroon CreditAttribution: juroon commentedsubscribe
Comment #17
Noe_ CreditAttribution: Noe_ commentedsubscribe
Comment #18
canucked CreditAttribution: canucked commentedWhat is the current status of this feature? How can one get involved in the development/testing?
Comment #19
marshallexcavating CreditAttribution: marshallexcavating commentedI am also interested in the current status of this feature; and would like to know how to get involved in development and testing.
Comment #20
rubenlor CreditAttribution: rubenlor commented+1
Subs
Comment #21
tigerfinch CreditAttribution: tigerfinch commentedI need this feature for a project in the near future and so have started today on a simple implementation of this. I will release a patch in the next few days, hopefully someone else will find this useful.
Comment #22
tigerfinch CreditAttribution: tigerfinch commentedOk, as promised here is a patch to provide this functionality.
For some reason ( I am not an experienced patcher! ) to get this patch to apply properly, I had to use the command:
patch -Np1 -d autoassignrole/ autoassignrole-paths-#971320-#21.patch
while in the directory containing the autoassignrole folder.
Remember to fully uninstall the module before using the patched version (it needs to run it's install file to add a table to the database...)
When the module is reactivated, you should find an extra menu option under admin/config/people/autoassignrole/ - called Per Role Pages. When you click on this you have the option to add a new role-specific page. You can choose which roles (more than one) are applied for this page, the title and the path. Make sure the path is not already in use (there is validation but I have found it slightly shaky..)
NB: concerning the path, you only need the root, as the subpages will be added. Eg. if you set the path to 'investor' - you will have a 'investor/login' etc. page generated.
There are two more options available. The display determines what type of page you want. If you choose standard, it will generate a page with tabs like the standard user login/register etc. page. The links will also be added to the menu you choose in the dropdown. If you choose individual, then they are not added to a menu and you will have to provide links to the pages ('string/register' etc.) - these pages have no tabs to link to the other pages.
Let me know how it goes, I hope the patching works ok!
Comment #23
g.paluch CreditAttribution: g.paluch commented+1 subscribe
Comment #24
natlandry CreditAttribution: natlandry commentedI am getting page not found error when I try to download this patch.
Comment #25
tigerfinch CreditAttribution: tigerfinch commentedWeird, don't know how I managed that. Here it is again:
Comment #26
tigerfinch CreditAttribution: tigerfinch commentedAnother attempt
[Edit: Apologies for turning into sir spam-a-lot. I realised (duh) that the hashes were causing problems. THIS one you should be able to get hold of ok....]
Comment #27
iRex CreditAttribution: iRex commentedsubs
Comment #28
ardnet CreditAttribution: ardnet commentedsubscribe
Comment #29
EvaldsUrtans CreditAttribution: EvaldsUrtans commentedsubscribe
Comment #30
ardnet CreditAttribution: ardnet commentedHi tigerfinch,
I tested your patch there, but seems there's no code in autoassignrole.install, no?
Thanks
Comment #31
hefox CreditAttribution: hefox commentedThere's a patch, so this is needs review, yes/no?
Comment #33
mrfelton CreditAttribution: mrfelton commentedAs per #30 it looks like the .install code is missing from the patch.
Comment #34
tbeauchemin CreditAttribution: tbeauchemin commentedsubscribe
Comment #35
basicmagic.net CreditAttribution: basicmagic.net commentedsubscribe
Comment #36
cenforprofesional CreditAttribution: cenforprofesional commented#26: autoassignrole-paths-971320-21.patch queued for re-testing.
Comment #38
middleman90 CreditAttribution: middleman90 commented#22: autoassignrole-paths-#971320-#21.patch queued for re-testing.
Comment #39
RKS CreditAttribution: RKS commentedIs anyone able to work on the patch and fix what's missing? Or anyone have a working solution?
Comment #40
RKS CreditAttribution: RKS commentedFor all
madmatter has supplied a patch in another issue here http://drupal.org/node/1334412#comment-5237696
The Prfile Registration Path module is a requirement of this functionality with his patch applied to Auto Assign Role, but the functionality is there for anyone who wants to test and see if this works for their use case.
Comment #41
stopshinal CreditAttribution: stopshinal commentedRKS - i'm confused, i've applied madmatter's patch, but in and of its self it does nothing, correct? we need this patch to add the UI for selecting which path gets which role, correct?
I'm just a bit turned around by posts here and over at http://drupal.org/node/1334412
Comment #42
grasmash CreditAttribution: grasmash commentedstopshinal,
True, the patch that I submitted does nothing in and of itself. It simply adds a new hook to AAR that will permit other modules to add their own roles to during user registration.
Combining this patch with Profile2 Registration Path (7.x-1.x-dev) will allow you to set unique registration paths per profile2 profile type and assign specific roles to users who register via that path, which may or may not accomplish what you'd like.
Comment #43
grasmash CreditAttribution: grasmash commented**UPDATE**
After receiving no response from AAR maintainers, I have removed AAR integration from Profile2 Registration Path.
Automatic assignment of roles during registration has been made native to the Profile2 Registration Path module. I'm sorry to have hijacked this thread. Good luck with the previously posted patch!
Comment #44
tigerfinch CreditAttribution: tigerfinch commentedHi all - sorry for dropping off the map for so long -
As several of you noticed, the .install file was missing from my patch. I am a little n00bish when it comes to patching I must admit. Working on a patch now, using the documented git method, so hopefully will be more successful.
Comment #45
tigerfinch CreditAttribution: tigerfinch commentedReworked patch uploaded!
Comment #46
msakurada CreditAttribution: msakurada commentedok maybe this is an over simplification, but I only needed to get the /user/register/trial ('trial' role assigned) functionality working.
So I cut up the module to a custom module, threw in a SESSION variable and all I need is this instead of the whole module:
I ensure the $role_key is greater then 3 to prevent administrator/built in roles from path assignment.
Anybody see problems? The SESSION variable lives on the server side so I don't think you can manipulate. This doesnt really contribute (it cuts out functionality) but its simple and clean. Thoughts?
Comment #47
TommyK CreditAttribution: TommyK commentedtested patch in #45
Here is what I did:
I'm so glad this patch is working well enough for me. I only mark it "needs work" because of the problems rebuilding the menu upon edit.
Thanks!
Comment #48
dgastudio CreditAttribution: dgastudio commentedwhy do not use profile2_registrationpath???
Comment #49
joeforika CreditAttribution: joeforika commentedHow do you apply this patch?? I tried to run the command in ssh inside the modules folder:
patch -Np1 -d / configurableregpaths-971320-44.patch
but it doesn't do anything and it doesnt give any error message either. pls help
Comment #50
DamienMcKennaThis should have a hook_update_N() script to migrate existing data from a D6 site (#1672630: Build D6->D7 upgrade path).
Comment #51
RaulMuroc CreditAttribution: RaulMuroc commentedWe need new co-mantainers of this module cuz since 2011 nobody works on this module and it is really useful.
Comment #52
Drupal prince CreditAttribution: Drupal prince commented#22: autoassignrole-paths-#971320-#21.patch queued for re-testing.
Comment #53
rogical CreditAttribution: rogical commentedlike #47, we need to disable/uninstall this module first, and applied the patch, then it works.
There're some small issues but the function is working, we can commit this first.
Comment #54
rogical CreditAttribution: rogical commentedThe 'allow user to choose' feature is missing, we still need to have both solutions:
Allow user to Choose, Assign from path
Comment #55
pinkonomy CreditAttribution: pinkonomy commentedAfter applying the patch I take an error message and the path doesn't appear .
patching file autoassignrole.admin.inc
Hunk #1 succeeded at 167 (offset -7 lines).
patching file autoassignrole.install
Hunk #1 FAILED at 5.
1 out of 1 hunk FAILED -- saving rejects to file autoassignrole.install.rej
patching file autoassignrole.module
Hunk #1 FAILED at 59.
Hunk #2 succeeded at 93 (offset 2 lines).
Hunk #3 succeeded at 157 (offset 2 lines).
1 out of 3 hunks FAILED -- saving rejects to file autoassignrole.module.rej
patching file autoassignrole.paths.inc
Comment #56
Berliner-dupe CreditAttribution: Berliner-dupe commentedIs a new info available for Register Role by Path for Auto Assign Role?
I dont use Profile2 and i cant use Profile2 Registration Path for this.
Comment #57
acdtrp CreditAttribution: acdtrp commentedYeah, me too. The third option is not available without Profile2, is it?
Comment #58
RaulMuroc CreditAttribution: RaulMuroc commentedI'm lost in this issue... which is latest patch? Could someone who knows re-attach it?
Comment #59
Anonymous (not verified) CreditAttribution: Anonymous commentedHere is the complete working module including the patch from #45 Thx to Tigerfinch. I had to remove the user_access ( 'administer users' ) in the autoassignrole_user_presave(&$edit, $account, $category) to get it working.
Comment #60
mike.davis CreditAttribution: mike.davis commentedHere is a re-rolled patch from #45 which applies fine now against the 7.x-1.x branch.
I have updated the .install file to use hook_update_N to create the new table so you don't need to uninstall, just apply the patch and run "drush updb"
I have also updated some of the comments to fit with coding standards.
Please review this as it would be good to get this in as a starting place for this functionality so that we can move to a stable release of 7.x-1.x.
There is a couple of things that I have noticed with this - there is no validation for existing paths of pages and there is no confirmation on deleting a page. These could be raised as new issues once it has been committed - unless the consensus is that these should be part of this patch (I think that the delete confirmation should be so might look at that)?
Comment #61
mike.davis CreditAttribution: mike.davis commentedHere is an updated patch from #60, which adds a delete confirmation page to the auto assign pages - it was more straight forward that I thought it might be.
I have also cleaned up some code to adhere to coding standards and refactored the retrieving of the auto assign role pages.
I have also updated the menu to use the menu tabs on the pages so that you can easily change what you want to edit within the auto assign role module, rather than having to go to the menu each time.
Comment #62
mike.davis CreditAttribution: mike.davis commentedOK, so I have update patch #61 further to set the schema on the .install file as well so that this sets the correct database table for new installs. I have also removed the menu tabs as this should really be part of a separate issue so I will create a new issue for this.
Comment #66
mike.davis CreditAttribution: mike.davis commentedPatch #62 has been committed. We could really do with some tests for this new functionality, so I will raise a new issue to look at these.