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

Effort Estimation Template for Steady State Support
Hi Everyone,

Is there any SAP provided template/format for system change and enhancements

Is it possible to stop reservation creation in PM Order?
Hi All,

Is it possible to stop reservation creation in PM Order?

Thanks in adv

Problem with coding MySQL query
I'm having heaps of trouble getting one of my PHP/MySQL queries to work for some reason (and the fun

Working with Global Variables
hi, I'm not really sure why the following code is returning a "Call to a member function getBan

Need a fuction to count entries in a field
Hi
I need a fuction to count how many times a email address is entered in to a field.

I ma

how to get sn motherboard
Hello.
I want to get serial number motherboard, cpu and else hardware.
Can You show me sam

upgrade from 4.7 to ECC 6.0
Hi all,
we are going to do an upgrade from R/3 4.7 to ECC 6.0. I need to know if i can find som

Forgot password won't work
My forgot password thing is not working properly. It is giving me this errorMailbox unavailable. The

Probably a simple error...
I'm getting the error -- Parse error: syntax error, unexpected '{' in /home/content/c/s/t/csteffen24

Is there a more efficient way to code this than what I have?
I have three associative arrays.

$combinedSettings
$userSettings
$defaultSettings

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