Jump to content

Login Permissions Or User Levels


Recommended Posts

Hi all,


I have an existing PHP/mySQL site with a login using sessions.


I'm pretty raw when it comes to PHP and am struggling to implement extended features to the login.


The login is pretty basic in that either you are logged in to everything or not. Any user account that is logged in has access to the pricing on our site (we're a wholesaler). Currently there is no way to segregate the users.


We are adding a section to the site that we want to limit to a very small number of customers for now.

So, my thought was to grant them additional privileges to get to that section.

- For the users, they would never have to do anything different, just login as usual and if they have the new privileges, they can access the new section.

- The controls for those privileges would be something as simple as a checkbox in the Admin Panel on the existing user account page. Once checked, privileges are granted and that user when logged in gains access to the new section.


So, I added a column into the user accounts table in the DB thinking that the default (unchecked) would be '0' or no privileges and if the admin checked the box in the admin panel that it would change to '1' and give them access.

I dunno if that's the best approach but it's what I'm attempting.


I'm reading and reading but not learning enough to get it to work. Basically, I'm not figuring out how to get the PHP working and/or put in the right place.


I know that's a little vague about the script. I'm new to PHP and really stuck, hoping I can get some pointers.


Thanks for any feedback!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...