Great module, I have been looking for a Registration Code feature for a while and only found this module today.

My website is currently invite only, using the invite module. Id also like users to be able to signup if they have a registration code. This doesnt seem possible as the invite module creates a new user setting "New user registration by invitation only." on admin/user/settings that interferes with both of these modules working together.

Is there anyway to use both of these modules? Invite is great so users can individually send invites to their friends email addresses, but I need the regcode functionality so I users can send out an invite code instead of needing to know the email addresses of people who they want to invite.

CommentFileSizeAuthor
#17 regcode_url.zip810 bytestoemaz
#16 regcode_url.zip787 bytestoemaz

Comments

j0k3z’s picture

The only way I can see this working is if the code generated by the INVITE module also acts as a Registration Code that works 1 time.

Then I could mark the Registration Code required when a user signs up and then change my websites signup settings to "Visitors can create accounts and no administrator approval is required."

Tthen I can give out a Registration Code that is good for 500 signups and not need everyones individual email address. The first 500 people to use this code on the signup page become members. Then these members can use the INVITE module to invite their friends via email addresses. Currently the invite modules send a registration link that looks like "example.com/invite/accept/ymcNNMLz" - so if that invite code also worked as a 1 time use RegCode and prefilled the register form everything would work perfectly.

Does this make sense? Is there an easier way?

aidanlis’s picture

Hi,

You'll need a custom module to do this: quite a simple module to check whether there's an invite code, and if there is, hide the regcode fields.

I don't have time for this at the moment, maybe put down a bounty and someone can write it for you.

Cheers,

j0k3z’s picture

I have no experience coding modules, can you give me an idea about where I should start looking to add this feature? Is there a function or something that would get me started?

aidanlis’s picture

Unfortunately there's quite a steep learning curve writing modules, you'll need to read the introduction to module development and hook_form_alter.

j0k3z’s picture

If anyone thinks they can hack this together then please let me know

aidanlis’s picture

If you make a donation I'll move it up my very long list of things to do :)

Avaz Mano’s picture

subscribing

Ela’s picture

subscribing

j0k3z’s picture

So it looks like a few other people are interested in this feature as well.

Is anyone willing to throw in some cash to help bump this up higher on aidanlis list of things to do?

aidanlis’s picture

Category: support » feature
Priority: Normal » Minor
drjonez’s picture

Haven't seen a lot of activity with this module. i've had it installed for a while. Nobody seams to eager to update it for this type of functionality, you may wanna check out the Registration Code module.

EDIT: Please strike the previous comment, i'm an idiot.

Anyway, subscribing

Ela’s picture

you may wanna check out the Registration Code module.

I'm a bit confused.. this is the Registration Code module... Or is there another one?

drjonez’s picture

ugh meant to reply in a different thread. sorry for the confusion

toemaz’s picture

Just to let you know, I'm on this.

aidanlis’s picture

Sounds good toemaz, if you need any help drop me a line on IRC.

toemaz’s picture

StatusFileSize
new787 bytes

Find attached a contrib module for the regcode module, which does one thing: look for the code in the url user/register/code/[code]. If it finds the [code], it injects the code in the textfield. Feel free to adapt the code to your own needs.

toemaz’s picture

StatusFileSize
new810 bytes

Small fix.

aidanlis’s picture

I don't think toemaz's module helps people trying to integrate with invite, but I agree it's a useful feature so I'll add it to core.

aidanlis’s picture

Title: Doesnt work with invite module? » Allow regcode to use invitations

I think the best way to fix this issue is a contributed module to allow users to email regcode invitations to their friends. This module could be implemented either in regcode (thus replacing the Invite module altogether) or in the Invite module as an addon for compatibility (the preferred solution, as mailing invitations is what the invite module does best).

I don't have time to implement such a request, so I'll leave this open for discussion.

aidanlis’s picture

Title: Allow regcode to use invitations » Send invitations using the regcode module
aidanlis’s picture

Status: Active » Postponed
mjut’s picture

I need to use both modules as well. Invite and Registration Code.

My approach is alternating the "invite.module". In that file you ll find the section

/**
 * Implementation of hook_form_alter().
 */
 

If you placed

unset($form['regcode']);

between:

if ($invite) {        

and:

// Preset the e-mail field.
  if (isset($form['account'])) {

the registration-code field will be deactivated.

Unfortunately, the field will be deactivated by directly visiting ../user/register too.
There must be a way to placing "unset($form['regcode']);" affecting the registartion form by coming from an invite-code only?

I know, my code must be hilarious - but I think this is the best way to explain my plan. Maybe there is someone who can help getting this to work?

Thanks
Stephan

mjut’s picture

I got some results. Both modules are working together if you:

1. In /admin/user/invite/settings you need to change the path to registration page to user/register/invite
2. add following code in the file invite.module just under
function invite_form_alter(&$form, $form_state, $form_id) {

if (arg(2) === 'invite') {
unset($form['regcode']);
}

Now, if you are visiting the page /user/register you will see the field for the Reg-Code.
If a user gets and invitation, the user will be redirected to user/register/invite where the Reg-Code field is disabled.

Thats it. But it is just an idea. Maybe that is a starting-point to make something better.
Because there is on big issue:
Anybody can visit user/register/invite without having an invite. As there is no Reg-Code Field anyone will be able to register. (I think so?)

What do you think about this workaround? Is there a way to make this bullet-proof?

Of course, this attempt is really bad - especially as I am messing with the code in the invite module !!!!!

iex’s picture

Subscribing

davito18’s picture

Subscribing