<?PHP
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");				// Date in the past
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");		// always modified
header("Cache-Control: no-store, no-cache, must-revalidate");	// HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");										// HTTP/1.0

if (isset($logout_session))
	{
	mysql_query("update user set sid='".md5(microtime())."' where sid='".addslashes(trim($sid))."' and status='69'");
	header("Location: ".$http_admin."/index.php"); 
	exit; 
	}
# 1. is a valid account?
if (auth_sid_admin($sid)!==0) 
	{ 
	header("Location: ".$http_admin."/index.php"); 
	exit; 
	}

/*
$expire=3600;

# Required
function start($expire)
	{
	GLOBAL $REMOTE_ADDR;

	mysql_query("delete from session");
	mysql_query("insert into session set sid='".md5($REMOTE_ADDR)."', created='".time()."'");

	return 1;
	}

# Required
function verify($expire, $http_admin)
	{
	GLOBAL $REMOTE_ADDR;
	GLOBAL $sid;
	
	# mysql_query("delete from session where (created + ".$expire.")<".time());

	$r0=mysql_fetch_array(mysql_query("select count(*) from user where rsid='".md5($REMOTE_ADDR)."' limit 0, 1"));
	
	if ($r0[0]<=0) { header("Location: ".$http_admin."/index.php"); exit; }
	else { mysql_query("update user set rsid='".md5($REMOTE_ADDR)."' where sid='".addslashes(trim($sid))."' and status='69'"); }

	return 1;
	}

verify($expire, $http_admin);
*/
?>