Don't allow users to select role more than once, even from account page

jazzslider - September 22, 2009 - 20:17
Project:User-Selectable Roles
Version:6.x-1.4
Component:Code
Category:feature request
Priority:minor
Assigned:jazzslider
Status:needs review
Description

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

AttachmentSize
allowreselect.patch2.54 KB

#1

Bacteria Man - September 22, 2009 - 21:14

This makes perfect sense when needing to bypass the registration page. Thanks for sharing the patch.

#2

matteoraggi - October 27, 2009 - 20:38

This 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?

#3

Bacteria Man - October 27, 2009 - 20:52

I hadn't planned to apply the patch since its application is for a small niche of users. I'm not against doing so though.

 
 

Drupal is a registered trademark of Dries Buytaert.