I have made a login system with 3 different classes of users. My requirement is that each user has a different menu (control bar).
How should I design this
-
Using the same page by using php call
if(user('student')='true') echo "unordered list"; else if(user('admin')=='true') echo "admin menu"; -
By using 3 different pages for each user and restricting if a different class user tries to access it.
Well I personally think that hiding links based on access level is a very weak form of security, on the other hand maintaining 3 different pages could be problematic on the long run.
I’d say on your menu you need to do something like:
and on each of the pages you should check that the current user has access to reach it, in case a student manages to guess the url to an admin page