Hi
I have to write a CMS that does something! I also have to make a user accounts area for the super user to add users and also define their permissions in using different parts of the control panel.
If it's a normal verification script, looking up the username & password in a database, I could write it in an include file and include it in all my pages. But what I have in here is really different, I don't wana check for the user permissions in all the pages. In order to get around it, I came up with this:
I check the username & password in the first page of the control panel, if it's valid, I set up a session variable with the value of "true", and then I make an array that contains the permissions that the user have, like Editing, Adding and etc.
So, in the other pages, I just check if that first session variable is true, and if yes, I lookup the permissions array and if he/she has correct permissions to use my page, I'll allow him/her to do so.
So, what do you think? Instead of checking for the username & passwords in all the pages, I'm just doing it in one page. Is there any security hole in this?! Can anyone fake a session variable?