Hello!
In our setup, we recently had a need to block users from modifying which user-selectable role they'd chosen once they'd already chosen one. Ordinarily this would be handled by turning off the "Registration and user account forms" setting, but since we're using LDAP integration for auth, we don't use the normal Drupal registration process. As a result, I've rolled the attached patch, which adds one more option to the UI…"User can select roles more than once", which to preserve BC, is true by default.
If this new option is unchecked, users will not be able to switch to a different user-selectable role after they've chosen one, regardless of whether they chose it via registration or account editing.
Hope this helps someone!
Thanks,
Adam
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | allowreselect.patch | 3.08 KB | jazzslider |
| allowreselect.patch | 2.54 KB | jazzslider |
Comments
Comment #1
johnhanley commentedThis makes perfect sense when needing to bypass the registration page. Thanks for sharing the patch.
Comment #2
matteoraggi commentedThis patch is being added on 6.x.1.5 ? So this issues can be closed, or maybe you coul add this patch to 6.x.1.6?
Comment #3
johnhanley commentedI hadn't planned to apply the patch since its application is for a small niche of users. I'm not against doing so though.
Comment #4
johnhanley commentedjazzslider,
If you don't mind creating another patch against the latest version of User-Selectable Roles I will apply it right away and issue a new release. No worries if not.
Thanks,
John
Comment #5
jazzslider commentedHello!
I've attached a tentative patch, but I haven't had the chance to test it out yet (apart from running a PHP lint check); I'll let you know once I've done so, but I thought I'd attach it anyway just to be proactive :)
Thanks!
Adam
Comment #6
johnhanley commentedThe existing 5.x/6.x branches of User-Selectable Roles have reached the end of their life cycle and no additional features will be added.
This patch can be applied to the current 6.x branch by those needing the functionality it provides. Thanks again for the contribution.