Basically I have a array like this
Code: Select all
[1] => w
[4] => r
[8] => r
[16] => w
[32] => w
[65536] => r
[64] => r
[128] => r
[256] => r
[512] => r
[1024] => r
[2048] => r
[8192] => r
[2] => r
[4096] => r
[32768] => r
[16384] => r"
when user has rperm=11 (b1011) then 11&4=0 (false)
when i want to change permission i use XOR?: 11^4=15 (1011^0100=1111) and 15^4=11 (1111^4=1011)
from adm_users.php:
Code: Select all
if($data['rperm']&(int)$item)
{
if($data['perm']&(int)$item)
{
$bla="perm='".($data['perm']^(int)$item)."',rperm='".($data['rperm']^(int)$item)."'";
}
else
{
$bla="perm='".($data['perm']^(int)$item)."'";
}
}
else
{
$bla="rperm='".($data['rperm']^(int)$item)."'";
}perm && !rperm = w
!perm && rperm = r
!perm && !rperm = n
"
Well OK! the $data['perm'] and rperm are the users current settings. the key of the array i showed is the website sections bitwise thing. I need to know what to make $item based off of the value of the array i posted to make it work. r = read, w = write, n = no permission at all.
I read some stuff on this but I am seriously at a complete loss. anyone have any help for this?