Topic: Unusual login system

Hi there,

I'm a complete beginner at Rails, I've completed lots of tutorials but I've set myself a small task and I'm not certain how to begin due to the slightly unusual setup.

I need to create a login where rather than a password users enter a code they have been given. The complication is that multiple people may be given the same code. Each code would have a maximum number of users.

Flow
- Admin generates or adds a code to the database and sets the number of users it will be available to, say 10.
- User submits the code and some personal details (which are recorded) and views the site
- User may re-enter the site using the same method
- After 10 users have submitted the code it is invalid

I'll also need an admin page for the admin to generate or manually enter the code and it's use limit but that seems simple enough.

What do you think, does this sound easy? What's the best place to begin?

Re: Unusual login system

So, essentially, it's something like a user registration coupon?

I think it's not hard to implement if you do understand how model and controller works.

Conceptually, you'll need a coupon table containing the unique code as primary key and other attribute to store max user for that particular coupon. In user table, you will need to reference the coupon via a foreign key.

Some question on your flow: do you really need to resubmit the code each time the user reenter the site?

Last edited by ang (2012-09-28 05:21:39)