PDA

View Full Version : My Permissions arent working>_<


AN-net
08-31-2004, 04:49 PM
ok im even logged out and it still doesnt deny the viewer

here is my code

if($journalinfo['private']==1)
{
if(($bbuserinfo['userid']==$journalinfo['journalist_id']) OR ($bbuserinfo['usergroupid']==6) OR (in_array($bbuserinfo['userid'], array($journalinfo['whocanview']))))
{
$canview['thisjournal']= true;
}
else if(($journalinfo['allowbuddies']==1) AND (in_array($bbuserinfo['userid'], $jbuddies)))
{
$canview['thisjournal']= true;
}
else if($bbuserinfo['userid']==0)
{
$canview['thisjournal']= false;
}
else
{
$canview['thisjournal']= false;
}
}
else
{
$canview['thisjournal']= true;
}

$journalinfo[private] is set to 1 so it should consider it private. i even add the if the statement for guests to assure they cant view it but still it doesnt work>_<

if $canview[thisjournal] returns false it should print no permission but it isnt. anyone know y?

rake
08-31-2004, 06:09 PM
in the bbuserinfo[userid] == 0 part, add the following:

echo "1";
print_r($canview);
exit;

if you don't get anything it means one of the above statements returns true, and it doesn't even get to this part.

Also, i'm guessing after this, there's something like:

if($canview['thisjournal'] == false)
{
print_no_permission();
}

AN-net
08-31-2004, 06:43 PM
well its just

if($canview['thisjournal'])
{
true stuff here
}
else
{
print_no_permission();
}

AN-net
08-31-2004, 07:22 PM
fixed it, turns out it was thinking the guest was in private list of viewers>_>