Hello all,
I plan to use two tables (i.e. guest and employee) to control which page is available to which user.
The guess can sign up for an account while the employee cannot. The account of an employee can only be assigned by a system administrator.
Here is the question I just found:
Assume UserA is a employee and has 'login001' as user name and 'password' as password.
Now, a guess comes to the website and applies for a user name with 'login001' and 'password' as password.
Then the userB can access some internal websites b/c he/she chose the same username/password as one of the employee does.
Here is my fix to this problem:
Method one: Whenever a user name is applied (not matter guess or employee), the both table guess and employee should be checked to make sure there is no duplicate.
Method two: Combine guess and employee tables together as person table. However, for guess, the user_type can be assigned as GUEST and for employee, the user_type can be assigned as EMPLOYEE.
I don't know whether above methods make sense or not. If neither or them are good solutions, please give me some direction so that I can adopt some best practice.
I am NOT using any framework or OOP to implement my PHP script.
Thank you