I'm building a user notification system on a website which involves 2 levels of registration: admin and client
I have all users register into a single registration table with the fields:
uid
email
password
owner
cid
admin
When an admin level user is inserted, the admin column is flagged with a 1 When a client level user is inserted, the admin column is 0, the owner is set to admin's uid admin level users cannot modify the client user's password the client level user can belong to multiple admins multiple admins can share the same client level users so it is possible for other admins to have clients who are admins
Problem My problem is when an admin user creates their client users, the client user may enjoy the site and might like to register as admin and setup potentially the same duplicate users with the same emails with different passwords. If this happens, the client becomes an admin, then there is the issue regarding whether the admin is still a client of the previous admin.
Example: Bob registers as admin and setup up Jack as a client user. Jack uses the site and likes it. He turns around and registers as an admin account user and puts Bob as his client user.
here the problem is you have emails with 2 diff passwords which leads to a login conflict
Obviously this is a bad design from the get go and can easily be solved with a unique username/password combo; however; I would like to find out what other suggestions the community might have while keeping the email address as the username in this situation.
final goal My final objective with this problem is I'm trying to figure out how social network sites not only manage their users but also how they establish "friendships" as well.
thanks in advance.