<?php
require_once("inc/session.php");

// if login already redirect rcmng/rc_list.html
//if ($HTTP_COOKIE_VARS[SUID] == "guru222")
if ($_COOKIE[SUID] == "guru222")
{
	echo "<script language='javascript'>";
	echo "opener.window.location ='rcmng/rc_list.html';";
	echo "self.close();";
	echo "</script>";
	die();
}

if(getenv("REQUEST_METHOD") == "POST")
{
	$passwd = $_POST["passwd"];
	if ($passwd == "skbb!@#")
	{
		SetCookie("SUID", "guru222", 0, "/");
		echo "<script language='javascript'>";
		echo "opener.window.location ='rcmng/rc_list.html';";
		echo "self.close();";
		echo "</script>";
		die();
	}
	else
	{
		echo "비번이 틀렸습니다!!";
	}
}
?>
<html>
<head>
<meta charset="euc-kr">
<SCRIPT LANGUAGE=JAVASCRIPT>
function content_check(form)
{
	pass = form.passwd.value.length;

	if ( pass == 0 ) {
		alert("비번을 입력 하세요.");
		form.passwd.focus();
		return (false);
	}
	return (true);
}

function check_passwd()
{
	document.form1.action = 'check_admin.html';
	document.form1.submit();
}
</SCRIPT>
</head>
<body>
<center>
<form name=form1 action='javascript:check_passwd()' method=post onSubmit='return content_check(this)'>
PASSWORD: <input type=password name=passwd size=15>
<br><input type=submit value="확인" border=0>
</form>
</center>
</body>
<script>
document.form1.passwd.focus();
</script>
</html>
