Does anyone know of a tutorial for creating a php login system connected to a mysql database with usergroups? I have most of my CMS for my website done, however I need to find a login system to restrict access to certain pages depending on their user group. For example a “staff” member would have access to a news submit page whereas a “registered” member would only have access to viewing pages or download pages.
To restict people, use sessions, so when there logined in check there sessions with the allowed for that page, so if they dont redirect them and if there allowed let themm access the page.
Go with what Seb says. Make an authorization table where you can store session ids and user ids. Then according to session id take that users info from database and siply check if this users usergroup applies for displaying specific content. Have this authorization script included on every site to guarantee some reasonable safety and you will do just ok.