Jump to content

What's Best Way To Do This?


phprocker

Recommended Posts

Hey all.  I have a script that checks if a user is an admin and then allows that person to change certain page layouts and other things.

 

My question is, of the following 2 examples, which is best way to check if the user is an admin.

 

1st example:

Should I have just a session that is set if the user is an admin and then have the pages displayed if he/she is?

 

or

 

2nd example:

Should I have each and every single admin query/request check if the user is an admin or not?

 

What's the proper method?

 

Cheers!

Link to comment
Share on other sites

To make things simple, many people will create an admin area to do all the major administration tasks.  One each page, when checking for the session, also check to see if the user has admin status.

 

It would be unwise to allow regular users to see admin tools and functions, only to have them be denied access when executing the script.  Just deny them access altogether by not letting them see the admin features in the first place.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.