Location: PHPKode > projects > Athena Research Assistant > athena-dev-0.1pre-alpha/includes/menu.inc.php
<?php
//BEGIN - CHECK IF THE USER IS ALLOWED TO DO THIS IN CASE OF A $_GET HACK
//THIS ENSURES THAT THE USER DOES NOT ATTEMPT ON SLIPPING VARIABLES IN THE URL
//IN ORDER TO OBTAIN ACCESS TO ADMINI PRIVILIDGES

//ASSING COLORS FOR SELECTED AND NON SELECTED, CHANGES ARE GLOBAL FOR THE WHOLE MENU
$select = "\"#F5F5DC\"";
$no_select = "\"#D0DCE0\"";

//THESE ARE USED TO MARK SELECTED OPTIONS

$thisUSERGROUP = $_SESSION["userGROUPID"];

$getUSERperm =	mysql_query("SELECT * FROM ath_groups WHERE " . //obtain permission values
				"ath_groups_id=$thisUSERGROUP");
				
$checkUSER = mysql_fetch_array($getUSERperm);				
//END - CHECK FOR $_GET HACK
?>

<table width="120" border="0" cellspacing="0" cellpadding="2">
	<tr>
		<td class="menu"><?php echo("<b>" . $ATHENAtitle . "</b>"); ?></td>
	</tr>
	
	<tr>
		<td class="menu" bgcolor="#ffffff">
			<hr noshade>
			<?php
			echo("User: <br><b>" . $_SESSION["USERrealNAME"] . "</b><br>");
			//echo("vuser: " . $_SESSION["valid_user"] . "<br>");
			//echo("UID: " . $_SESSION["UID"]);
			//echo("GrpID: " . $_SESSION["userGROUPID"]);
			
			?>
			<hr noshade>
		</td>
	</tr>
	
	<tr>
		<td bgcolor="#666666" class="menu_heading">A D D :</td>
	</tr>
	
	
	<?php
	//ALLOW ADDING NOTES
	if ($checkUSER["ath_groups_addNOTES"] == 1){
		if ($_GET["menu"] == "addnote"){
			$bg = $select;
			$lf = $leftBRACE;
			$rt = $rightBRACE;
		}
		else{
			$bg = $no_select;
			$lf = "";
			$rt = "";
		}
		
		echo("<tr>");
			echo("<td bgcolor=" . $bg . ">" . $lf .  " <a href=\"main.php?menu=addnote&act=addnote&valign=middle\" class=\"menu\">Notes</a> " . $rt . "</td>");
		echo("</tr>");
	}
	//ALLOW ADD RESOURCES
	if ($checkUSER["ath_groups_addRESRC"] == 1){
		if ($_GET["menu"] == "addresrc"){
			$bg = $select;
			$lf = $leftBRACE;
			$rt = $rightBRACE;
		}
		else{
			$bg = $no_select;
			$lf = "";
			$rt = "";
		}
		
		echo("<tr>");
			echo("<td bgcolor=" . $bg . ">" . $lf . " <a href=\"main.php?menu=addresrc&act=addresrc&valign=middle\" class=\"menu\">Resources</a> " . $rt . "</td>");
		echo("</tr>");
	}
	//ALLOW ADD PROJECTS
	if ($checkUSER["ath_groups_addPROJECTS"] == 1){
		if ($_GET["menu"] == "addproject"){
			$bg = $select;
			$lf = $leftBRACE;
			$rt = $rightBRACE;
		}
		else{
			$bg = $no_select;
			$lf = "";
			$rt = "";
		}
		
		echo("<tr>");
			echo("<td bgcolor=" . $bg . ">" . $lf . " <a href=\"main.php?menu=addproject&act=addproject&valign=middle\" class=\"menu\">Projects</a>" . $rt . "</td>");
		echo("</tr>");
	}
	//ALLOW ADDING USERS
	if ($checkUSER["ath_groups_addUSERS"] == 1){
		if ($_GET["menu"] == "adduser"){
			$bg = $select;
			$lf = $leftBRACE;
			$rt = $rightBRACE;
		}
		else{
			$bg = $no_select;
			$lf = "";
			$rt = "";
		}
		
		echo("<tr>");
			echo("<td bgcolor=" . $bg . ">" . $lf . " <a href=\"main.php?menu=adduser&act=adduser&valign=middle\" class=\"menu\">New users</a> " . $rt . "</td>");
		echo("</tr>");
	}
	//ALLOW ADDING GROUPS
	if ($checkUSER["ath_groups_addGROUPS"] == 1){
		if ($_GET["menu"] == "addgroup"){
			$bg = $select;
			$lf = $leftBRACE;
			$rt = $rightBRACE;
		}
		else{
			$bg = $no_select;
			$lf = "";
			$rt = "";
		}
		
		echo("<tr>");
			echo("<td bgcolor=" . $bg . ">" . $lf . " <a href=\"main.php?menu=addgroup&act=addgroup&valign=middle\" class=\"menu\">New Groups</a> " . $rt . "</td>");
		echo("</tr>");
	}
	?>
	
	<tr>
		<td bgcolor="#666666" class="menu_heading">V I E W :</td>
	</tr>
	
	<?php
	//ALLOW VIEWING RESOURCES
	if ($checkUSER["ath_groups_addRESRC"] == 1){
		
		//SET CELL BG TO INDICATE SELECTED OPTION 
		if ($_GET["menu"] == "viewresrc"){
			$bg = $select;
			$lf = $leftBRACE;
			$rt = $rightBRACE;
		}
		else{
			$bg = $no_select;
			$lf = "";
			$rt = "";
		}
		//SHOW ROW
		echo("<tr>");
			echo("<td bgcolor=" . $bg . ">" . $lf . " <a href=\"main.php?menu=viewresrc&act=viewresrc&valign=top\" class=\"menu\">My resources</a> " . $rt . "</td>");
		echo("</tr>");
	}
	//ALLOW VIEWING PROJECTS
	if ($checkUSER["ath_groups_addPROJECTS"] == 1){
		if ($_GET["menu"] == "viewprojects"){
			$bg = $select;
			$lf = $leftBRACE;
			$rt = $rightBRACE;
		}
		else{
			$bg = $no_select;
			$lf = "";
			$rt = "";
		}
		//SHOW ROW
		echo("<tr>");
			echo("<td bgcolor=" . $bg . ">" . $lf . " <a href=\"main.php?menu=viewprojects&act=viewprojects&valign=top\" class=\"menu\">My projects</a> " . $rt . "</td>");
		echo("</tr>");
	}
	//ALLOW VIEWING GROUPS
	if ($checkUSER["ath_groups_viewGROUPS"] == 1){
		if ($_GET["menu"] == "viewgroups"){
			$bg = $select;
			$lf = $leftBRACE;
			$rt = $rightBRACE;
		}
		else{
			$bg = $no_select;
			$lf = "";
			$rt = "";
		}
		
		echo("<tr>");
			echo("<td bgcolor=" . $bg . ">" . $lf . " <a href=\"#\" class=\"menu\">All groups</a> " . $rt . "</td>");
		echo("</tr>");
	}
	//ALLOW VIEWING PUBLIC RESOURCES
	if ($checkUSER["ath_groups_addtoPUBLIC"] == 1){
		if ($_GET["menu"] == "public"){
			$bg = $select;
			$lf = $leftBRACE;
			$rt = $rightBRACE;
		}
		else{
			$bg = $no_select;
			$lf = "";
			$rt = "";
		}
		
		echo("<tr>");
			echo("<td bgcolor=" . $bg . ">" . $lf . " <a href=\"main.php?menu=public&act=public&valign=top\" class=\"menu\">Public Resources</a> " . $rt . "</td>");
		echo("</tr>");
	}
	?>
	
	
	
	<tr>
		<td bgcolor="#D0DCE0"><hr noshade></td>
	</tr>
	
	<tr>
		<td bgcolor="#D0DCE0"><a href="#" class="edits" onClick="openwinSMALL('../helpfiles/FAQ.html', 'FAQ', 640, 480);">[&Omicron;]</a> <a href="../helpfiles/FAQ.html" class="menu">FAQ</a></td>
	</tr>
	
	<tr>
		<td bgcolor="#D0DCE0"><a href="#" class="edits" onClick="openwinSMALL('../helpfiles/docs.html', 'Docs', 640, 480);">[&Omicron;]</a> <a href="../helpfiles/docs.html" class="menu">Documentation</a></td>
	</tr>
	
	<tr>
		<td bgcolor="#D0DCE0"><hr noshade></td>
	</tr>
	
	<tr>
		<td bgcolor="#D0DCE0"><a href="../logout/logout.php" class="menu">Log Out</a></td>
	</tr>
	
	<tr height="10">
		<td bgcolor="#D0DCE0">&nbsp;</td>
	</tr>
</table>
Return current item: Athena Research Assistant