Reputation: 131
I want to setup certain password protected pages but want the pages accessible only to certain users. Do I need to pre-assign usernames and passwords, or is there a way to set up my database so it will detect those users I want to authorize and grant access to?
Upvotes: 0
Views: 1076
Reputation: 131
I think the best solution for my situation was to add to the query AND userlevel='1' and set the db to a default of 0 and change authorized users to 1.
Upvotes: 0
Reputation: 1267
You can store the usernames and passwords in the database, and then check the access rights to the protected pages.
Upvotes: 1
Reputation: 22114
For such situations, you could use different privileges for users. Set a corresponding session variable to indicate current users privilege level. And of course, you would need to have that information regarding privileges in database.
Upvotes: 1