Subject: Invite codes
Hello.
I added a patch to my board that uses "promo codes" in the registration.
Here`s why and how it works:
On my board I have a lot of subforums. Each of them is about a single project, website usually. Each of the subforums has it`s own group set up with ACL that allows to view and post to this group. The members group hasn`t got access to any forum.
So now, when someone registers, he/she has no rights granted until someone adds him/her to a group.
That`s why I added promo codes. While registering, you may enter a "promo code". If the the registration is successful, the promo code is entered and matches one of the groups` promo codes, the user is added to this group automatically,
Now, on every website I can add an invite link to the forum:
http://example.com/forum/forum.…?req=register&code=m…
When user registers, he gets access to the specified project-related subforum, without the need of administrator to add him manually. Yeah, I know that there are public groups, but thats not the same. Not anyone can find out the promo code, and giving a special link to register is easier than giving a simple link and a note: "after you register, please edit your profile, find groups and add yourself to Xyzzy group".
What`s under the hood?
Every group has another field, "promo code". It`s optional. Registration form has this field as well. When user registers, the code is checked against the codes in "GroupNames" table, and if a match is found, the user is added to this group.
For now I am doing a little magic to auto-create the promo codes (I didn`t have time to finish that), but for the registering user it changes nothing.
Patch attached. Briefly tested, so treat this as an alpha release. Does it have a chance to get to the next board release? Of course it needs to be finished (groupeditor and some configuration option to switch it off). This may be connected with "user invite" registration mode.
I find UNB very easy to modify and patch (and I usually don`t like it in other software), so I`d like to contribute a lot. And if my changes would land in the board`s base code, I wouldn`t have to worry about patching the new releases after upgrade.
I added a patch to my board that uses "promo codes" in the registration.
Here`s why and how it works:
On my board I have a lot of subforums. Each of them is about a single project, website usually. Each of the subforums has it`s own group set up with ACL that allows to view and post to this group. The members group hasn`t got access to any forum.
So now, when someone registers, he/she has no rights granted until someone adds him/her to a group.
That`s why I added promo codes. While registering, you may enter a "promo code". If the the registration is successful, the promo code is entered and matches one of the groups` promo codes, the user is added to this group automatically,
Now, on every website I can add an invite link to the forum:
http://example.com/forum/forum.…?req=register&code=m…
When user registers, he gets access to the specified project-related subforum, without the need of administrator to add him manually. Yeah, I know that there are public groups, but thats not the same. Not anyone can find out the promo code, and giving a special link to register is easier than giving a simple link and a note: "after you register, please edit your profile, find groups and add yourself to Xyzzy group".

What`s under the hood?
Every group has another field, "promo code". It`s optional. Registration form has this field as well. When user registers, the code is checked against the codes in "GroupNames" table, and if a match is found, the user is added to this group.
For now I am doing a little magic to auto-create the promo codes (I didn`t have time to finish that), but for the registering user it changes nothing.
Patch attached. Briefly tested, so treat this as an alpha release. Does it have a chance to get to the next board release? Of course it needs to be finished (groupeditor and some configuration option to switch it off). This may be connected with "user invite" registration mode.
I find UNB very easy to modify and patch (and I usually don`t like it in other software), so I`d like to contribute a lot. And if my changes would land in the board`s base code, I wouldn`t have to worry about patching the new releases after upgrade.
The author has attached one file to this post:
promo.patch 3.1 kBytesYou have no permission to open this file.

puck
Show profile
Link to this post