<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

if($is_member && $is_admin != "super") {
	// 이호경님 제안 코드
	session_unset(); // 모든 세션변수를 언레지스터 시켜줌
	session_destroy(); // 세션해제함

	// 자동로그인 해제 --------------------------------
	set_cookie('ck_mb_id', '', 0);
	set_cookie('ck_auto', '', 0);
	// 자동로그인 해제 end --------------------------------
	echo '<script>confirm("UNDER CONSTRUCTION!!!");location.replace("'.G5_BBS_URL.'/login.php"); </script>';
}
if(!$is_member && !preg_match("/bbs\/login(_check)?.php$/i", $_SERVER['REQUEST_URI'], $match)) header("Location: ".G5_BBS_URL."/login.php", true, 302);
else if(preg_match("/bbs\/login.php$/i", $_SERVER['REQUEST_URI'], $match)) {
$login_action_url = G5_HTTPS_BBS_URL."/login_check.php";
?>
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<title>Login</title>
<style>
	* {
		margin: 0px;
		padding: 0px;
	}
	body {
background-color: #fff; 
background-image: 
linear-gradient(90deg, transparent 79px, #abced4 79px, #abced4 81px, transparent 81px),
linear-gradient(#eee .1em, transparent .1em);
background-size: 100% 1.2em;
	}
	
	#form_wrapper::before,
	#form_wrapper::after {
		content: "";
		display: block;
		clear:both;
		width: 0px;
		height: 0px;
		visibility: hidden;
	}
	
	form {
		display: block;
		float: right;
		margin: 10px;
	}
	input {
		display: block;
		float: left;
		margin: 2px;
		width: 120px;
		font-size: 12px;
		line-height: 12px;
		padding: 5px;
		border: 1px solid #DDD;
	}
	
	input[type="submit"] {
		font-size: 12px;
		line-height: 12px;
		padding: 7px;
		border: 0px;
		background-color: #DDD;
	}
	
	h1 {
		text-align: center;
		margin-top: 200px;
	}
	
</style>
</head>
<body>
<div id="form_wrapper">
	<form name="flogin" action="<?php echo $login_action_url ?>" method="post">
		<input type="text" name="mb_id" id="login_id" required class="frm_input required" size="20" maxLength="20" placeholder="ID">
		<input type="password" name="mb_password" id="login_pw" required class="frm_input required" size="20" maxLength="20" placeholder="PASSWORD">
		<input type="submit" value="관리자 로그인">
	</form>
</div>
<h1>UNDER CONSTRUCTION</h1>
</body>
</html>
<?php
die();
}
?>