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

records between 2 dates
Hello all,

I have a date tracked table which contains effective_start_date and effective

Bit manipulation program with binary operations
My homework is to create a program to scan in and add binary numbers and print them like so

PHP Error
On my .php page I have a drop down box that has several names in it. When a user clicks the name &am

mr8m - reverse document
Friends,

I'm trying to reverse a document held by MIRO, but it reports the message balan

Big O & time complexity ???
can you help me how to calculate the Big O & time complexity for any algorithm and c++ program pleas

upload photo limits
ive got a upload photo script and im just trying to make more secure currently it limits size and as

Warning message
I've put a website that I was doing live and I'm getting this warning message when I try to add a ne

How to display random record from table?
I have the following code:

Code: <?php
$display_block .= "<input type=

Calling variables
I want to call this to my website but it doesn't display what I want it to,

Code: <h5&

Material Issuing for receiving batch
Dear All experts in MM/ PP,

Material issuing from main stores to factory is currently usi

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