I never thoght of it before, but lets see ..
when a person login on any login page what happens ?
1. database is already working and there is a table called users(user, password (encrypted)), we compare username and password and give user the access.
--> Problem: what If I have to define roles on the user, rolese can be defined on the database user rather than a user in a users table, RIGHT !!
that means, the user and password used to login should be database user password, created by CREATE USER by admin if I want to define roles on these users.
--> Problem: If user does not exist, he cannot login into the database, and even if he want to register, how could he register to the database, any clue ??
--> solution: if a person is already a user he will be able to login in, otherwise there will be a database exception so, a person has to register, to register .. our login page should remember a dummy user and password who has access to one table to database in which request could be saved .. and thats all. Next time admin will login and see the request and he will create a user looking at the request .. and hence the person who made a request can LOGIN now,
--> this solves the problem of ROLES, Admin can assign roles to the user he creates !!
---------------------
** IS this the way its done in REAL world ??? **
---------------------
Regards,