Location: PHPKode > projects > STAPLER > include/checkAdmin.php
<?
	/////////////////////////////////
	//
	// - check if user is admin
	// - if not, go to login or index 
	//
	// - check if user is trying to access something they shouldn't be
	//
	/////////////////////////////////

	if (!isset($numDirsDown))
		$numDirsDown = 0;
	$dir = "";
	for ($i=0; $i<$numDirsDown; ++$i)
		$dir .= "../";

	include_once ($dir . "definitions.php");


	if (!isset($sess_level))
		include $dir . "checkSession.php";

	if (isset($sess_level) && $sess_level==GUEST)
		header("Location: " . $dir . "../login/login.php");
	if (isset($sess_level) && $sess_level!=ADMIN)
		header("Location: " . $dir . "../index.php");

?>
Return current item: STAPLER