<? include $DOCUMENT_ROOT."/zzzfilelist.inc"; ?>
<? include Inc("metootop.inc.php"); ?>
<? $where="adminpageaccess"; include Inc("checkgameaccess.inc.php"); ?>
<center><br>
<?
	$authok=false;
	if ($gamepassword!="") {
		$fn=Inc("access.csv");
		$fp = fopen ($fn, "r");
		$adminpass = fread($fp, filesize($fn));
		fclose($fp);
		if ($gamepassword==$adminpass) { $authok=true; }
	}
	if ($authok) {
		$initfocus="onLoad='javascript:validate.go.focus()'";
	} else {
		$initfocus="onLoad='javascript:check.gamepassword.focus()'";
	}
?>
<?
	if ($gamepassword!="") {
		if ($authok) {
?>
<font class='jaunePALE'><b>Access granted</b><br><br>
<form name="validate" action="adminpage.php" method="post">
	<input type="hidden" name="access" value="ok">
	<input name="go" type="submit" value="Access admin">
</form>
<?
		} else {
			echo "<font color=red><b>Incorrect password</b></font><br>";
		}
	}	
	
	if ($gamepassword=="") {
		echo "<font class='jaunePALE'><b>Enter password</b></font><br>";
?>
<form name="check" action="adminpageaccess.php" method="post">
	<input type="password" name="gamepassword">
	<br>
	<input type="submit" value="Go">
</form>
<?
	}
?>
<? include Inc("metoobottom.inc.php"); ?>