Welcome Guest, Not a member yet? Register   Sign In
Beta Invitation Codes
#1

[eluser]Radou[/eluser]
Hello,

I am almost done with an app development using CI, but now I would like to make the beta only available to few people, only those who request a beta code.

Actually I would like to understand how this process works, are codes generated automatically ? Can codes be valid for only certain time let's say only valid for 24h ?

What is the best way of designing the background db table to host these actions.

Thanks for your answers in advance

#2

[eluser]micfai[/eluser]
I did this with email confirmation. Its fairly simple to do. Have the codes generated automatically. Insert that beta code into a table along with an expiration date and when the code is entered check to see if the current time is past the date set in the table.

If the code is not expired, you can then let them make an account or whatever you want them to do.
#3

[eluser]Vheissu[/eluser]
The way I have done it in previous projects is:

A beta codes table:

id - auto increment, int 10
beta_code - A random 16 character string md5 encrypted
expiry_date - An expiry date for the code
email_address - varchar (120) optional column in your table for restricting code to an email address
code_used - int(1) 0 for no and 1 for yes, to keep track of codes used

User visits URL: http://yourdomain.com/register/98sdhasjk...4jhkjhfdsf

This would hit a register controller expecting a code in the URL:

The code would be checked against the table, if it exists allow registration and if not, show an error message. I might release my beta codes library I wrote a little while ago for Codeigniter when I get the time to make some tweaks for others to use it. Good luck.




Theme © iAndrew 2016 - Forum software by © MyBB