It would be great to be able to assign certain roles to a user based on what registration code they used. In other words assign a registration code to give a user a certain role when they sign up for the site. This way, along with node privacy by role, the users access would be determined by what registration code they used.

CommentFileSizeAuthor
#11 rolebased.patch5.16 KBcineasta
#8 rolebased.patch5.02 KByraber

Comments

colan’s picture

Status: Needs work » Active

Makes sense to me. Do you have any code for this? I don't see a patch anywhere.

prytzen’s picture

No i wont even begin to think that i know what i am doing on the back end of drupal. Just a suggestion that i think would be VERY useful and not too difficult to implement.

colan’s picture

Ah, okay. You confused me when you set the status to "patch (code needs work)". Let's leave this open and see if anyone picks it up. I don't have time or funding to work on this right now.

bomarmonk’s picture

You could probably appropriate some of the code from one of the existing "role promotion" modules...

jnraajan’s picture

Does anyone have this module ported to work with D6

rajasekharan’s picture

I'm intersted in something like this too.

jorisx’s picture

nice,
patch the last D5 release of this module and it works nice with D6.5 :-)
Any thoughts on releasing a real def. version of this module?

yraber’s picture

StatusFileSize
new5.02 KB

Here is a patch that should do the trick.

* Registration keys are set per role
* The same key can be set for several roles, all the roles will be assigned to the user
* Added also the following options : optional registration key, textfield title and description

Hope you enjoy it.

yraber’s picture

Category: feature » bug
Status: Active » Needs review
cineasta’s picture

HI,

I tested the module and your provided patch. But as soon as there is more than one code provided it doesn't work anymore.
There is a problem with line breaks. For example if your codes look like this:
156887
458657
277758

So you have to change
$codes = explode("\n" , $codes);
into
$codes = explode("\r\n" , $codes);
Cause you need a carriage return (\r) and newline (\n) to separate text from a textarea.

cineasta’s picture

StatusFileSize
new5.16 KB

I changed your patch - please check.

danielnolde’s picture

Hey regcode-users,

i just posted a ready-for-review proposal of a completely reworked new regcode.module (still D5, but soon to be upgraded to D6 & D7). This new to-become-release is solving a lot of feature-requests and issues (this one too!) on a completely new and flexible basis.

Check it out, test it and give feedback whether you think it solves your issues, and whether it's ready to be committed:

http://drupal.org/node/466630

cheers,

daniel

aidanlis’s picture

Status: Needs review » Closed (fixed)