Location: PHPKode > projects > Mozart > Mozart-0.0.4/reqlogin.inc
// called from: every module should include this module
// description: ensures that the user is who (s)he claims to be by validating the
//              cookie variables (set in login.php) against the USER table;
// get info from cookie variables
$SysID  = $cookie[SysID];
$UserID = $cookie[UserID];
$Passwd = $cookie[Passwd];

// validate cookie variables against USER table
$CheckUserSQL = "SELECT user_id FROM users WHERE system_id = '$SysID' AND user_id = '$UserID' AND password = '$Passwd'";
$CheckUser    = mysql_query($CheckUserSQL,$db);
$checkuser    = mysql_fetch_array($CheckUser,$db);

//if $checkuser is empty, then the given cookie info is invalid and user needs to login
if (!(checkuser)) {
	$Message = "Invalid System ID";
Return current item: Mozart