Unnamed
public php v1 · immutable//loginhandler function...function checkPermission($group) { if (isset($_SESSION['usergroup'])) { return ($_SESSION['usergroup']<=$group); // Returning true means that // } // the user has permission. // else { throw new Exception("User not logged in."); } }...//indextry{ if(!($LoginHandler->checkPermission(1))) { header('Location: index.php'); }} catch (Exception $e){ echo "Error:". $e->getMessage() ."\n";}