jhm15217/worthreading — pull request #26 by mvillena3 (2012-07-23 18:58:21+00:00)
Title: Retweak user creation

I retweaked user creation.

There were several issues I was thinking about with the user creation:
1. Say if I signed up with your email. You would not be able to sign up since your email was already taken. Thus, I set it up so that users can only sign in after confirming their email. So User sign up process is:
a. User signs up and gets redirected to a page that asks for them to confirm email through email confirmation
b. User receives email and follows link to confirm email
c. User's email is confirmed and they can now sign in
2. What if an email is already registered ( i.e. User 1 creates User 2 when he adds User 2 to his subscriber list. Thus, User 2 is already in the database.), so I checked if the email is in the database and if it was the parameters would be updated instead of a new user being created.
3. But what if User 2 himself registers and someone else say Hacker 1 tries to register with User 2's email address after. Won't it update the attributes of User 2. Thus, I checked if their email is confirmed. Only non-confirmed emails will have their parameters updated. Confirmed emails will return an error in the form stating that the email was already taken.