I've created a hack, which upon some brief testing, appears to allow the user to choose a role upon login. This role can be configured in the logintoboggan settings. This works in Drupal 4.7.4.

I've attached the file to this message in the hope that these small changes might make it into a future release of logintoboggan.

Comments

dwees’s picture

Status: Active » Needs review
hunmonk’s picture

Status: Needs review » Needs work

this is not a patch -- it's the entire file. please submit a patch in the proper unified diff format.

dwees’s picture

Version: 4.7.x-1.x-dev » 5.x-1.x-dev
StatusFileSize
new5.74 KB

This is a patch for the 5.0 version. Should be straight forward to backport this patch to the 4.7 version pretty easily.

hunmonk’s picture

patch no longer applies.

also, do you see this as generally useful? how many sites have a need for users to pick their own roles?

auto role assignment i can understand, but i believe there are other solutions for that

dwees’s picture

We were using it so that users could create application forms specific to their role. So a teacher could create an application for work, and a student could create an application for the school, and at the same time we could collect some profile information, and limit spam applications.

Seemed to work fine, but it is definitely a specialized situation.

Dave

Anonymous’s picture

An earlier contributor said: "auto role assignment i can understand, but i believe there are other solutions for that"

Can you tell me the best solution to assign a role when using Login Toboggan?

Thanks!

yeeloon’s picture

hi!

Does the above patch apply to this post http://drupal.org/node/129411#comment-620558 , whereby I'm using:

logintoboggan 5.x-1.x-dev 2007-Oct-11
Role signup5.x-1.x-dev 2007-Jun-19

... when both activated, the role signup ain't assigning any roles... but at least a message tells the user to check their email. But, when only the rolesignup is activated, user gets assigned to the role apply (that's good!) but, they get redirected to the homepage (without any message telling them to check their mail).

So, is there any advice or workaround that we can use?

hunmonk’s picture

Status: Needs work » Closed (won't fix)

i'm not going to add this to the official module. feel free to create your own custom hacks, though -- it is FOSS, after all ;)

nimi’s picture

Does this patch work for Drupal 6?

alienzed’s picture

I fixed this by hacking user.module around line 2320 where it calls

$account = user_save(...
I set my role in $merge_date and voila!

alienzed’s picture

I fixed this by hacking user.module around line 2320 where it calls

$account = user_save(...
I set my role in $merge_date and voila!