controlling/creating accounts with privileges


Posted on 16th Feb 2014 07:03 pm by admin

hi all,
i'm trying to figure out how i can create/control account with privileges, for instance an Administrator creates an account but gives it guest privileges (able to see data but not edit, or delete it, not able to create users).

when a user logs in, i store his/her privileges is a session.
Did you know?Explore Trending and Topic pages for more stories like this.
Code: $_SESSION['staff_privilege'] = $found_user['privilege'];
i wrote this function to check for privileges and placed it in the create user page. (1 = admin, 2 = guest)
Code: function get_privilege() {
if (logged_in() && isset($_SESSION['staff_privilege'])) {
if ($_SESSION['staff_privilege'] == 2) {
redirect_to("../staff/staff_browse.php?privilege=false");
}
} else {
redirect_to("../staff/index.php");
}
}

for instance if a user with guest privileges goes to create user page, he/she will get redirect to another page showing a message.

the above code is working, but i'm wanted other ideas about how this could be accomplished in another way
thanks
No comments posted yet

Your Answer:

Login to answer
142 Like 29 Dislike
Previous forums Next forums
Other forums

Help with PHP Email Script
Hi guys,

I'm a newbie to php and need help with the script below:

At the moment when I

GIS appliction help
I found some tutorials in the internet to develop a map application I don't want to use google maps

Email to a friend script problems
I have this send-to-a-friend script with 2 issues:


1) When you open the form popup on a p

List/Menu Box
On an edit page when you want something to select what a user has previously selected from the datab

Rss feed question
Hi

My blog and my website are different. Am i able to take my rss feed
from my blog and p

help with variable
I've got a problem, i want to echo some images depending on the $id, however for me to get that id i

Displaying a record from mysql in a simple swf file
Hi,

I have a mysql database containing information I would like to display in my swf.

Auto install
Hi I have a directory lets say "apps" that I then have more folders ie "email",

How can I get my program to read a larger array ??
Hi:

I have this program that reads from an array to do calculations. The array are just t

help with multi-update
Now sure how to ask this really....
10g database if that matters.

I have a customer

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash