All pastes #604710 Raw Edit

Unnamed

public php v1 · immutable
·published 2007-07-05 19:04 UTC
rendered paste body
//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";}