09-17-2017, 07:03 PM
Try reversing the logic by killing the page or redirecting somewhere if the user is not logged in or does not have permission first. Here's a an example with die();
Code:
<?phpCode:
if (!$user->isLoggedIn() || !hasPerm([2],$user->data()->id)){Code:
die(); //or somethingCode:
}else{Code:
//the rest of your scriptCode:
?>
