<?php
//exit;
session_start();
ob_start(); 
$MeUser=$_SESSION['session_var'] ;
//echo 'MeUser'.$MeUser;
//exit();
require_once("getAct.php");

$acti2=getactive($MeUser);
if ($acti2==""){$acti2=0;}
if ($MeUser=="Admin"){$acti2=1;}
//echo $acti2;
//exit();
if ($acti2 == 0)
{
echo "You have been deactivated. Please Contact Wealth Mark";
?>
<script language="javascript" type="text/javascript">
window.location = "../wapactivate.php";
</script>
<?php 
header("Location: ../wapactivate.php");
exit();
}

if ( @$_SESSION['session_var'] =='')
{
echo "Session ended. Please Log in";
@header("Location: ../login.php");
exit();
}

if ( @$_SESSION['session_var'] <> @$_SESSION['sess'])
{
@header("Location: ../login.php");
//echo $GLOBALS['Uname'];
//echo $_SESSION['sess'];
exit();
}


//$MeUser=$_SESSION['My_Group_Sec'];
$RECE=$_SESSION['sess_Group'];
//	echo $RECE;
If ($RECE=='Administrator' || @$ThisScreen=='Mine' || $RECE=='Company')
{

}
Else
{
//Include("Datacon.inc");
//$MyScreen="Client";
@$result = mysql_query("SELECT GSP_SECURITYID, GSP_SEC_LEV FROM Group_Security_Permissions WHERE (((GSP_SECURITYID)='" . @$ThisScreen . "') AND ((GSP_GROUP)='$RECE'))");
//echo "SELECT GSP_SECURITYID, GSP_SEC_LEV FROM Group_Security_Permissions WHERE (((GSP_SECURITYID)='$ThisScreen') AND ((GSP_GROUP)='$RECE'))";
@$Myrow=mysql_fetch_array($result);
$ClientC=$Myrow["GSP_SEC_LEV"];
	if ($ClientC==5)
		{
		//Echo "I'm in";
		}
	else{
		echo "<font face='tahoma' size='2'> $MeUser You are not allowed to view this page <B>'Permission Not Granted to .".  @$ThisScreen . "'</B>. Please contact Your System Administrator </font>";
		exit();
		}
}
$MyCdate=date("d/m/Y");
$MyClDate="19/04/2007";
//Echo $MyCdate;
//Echo $MyClDate;
//If ($MyCdate >= $MyClDate){Exit();}
?>
