<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

if ($g4['https_url']) {
    $outlogin_url = $_GET['url'];
    if ($outlogin_url) {
        if (preg_match("/^\.\.\//", $outlogin_url)) {
            $outlogin_url = urlencode($g4[url]."/".preg_replace("/^\.\.\//", "", $outlogin_url));
        }
        else {
            $purl = parse_url($g4[url]);
            if ($purl[path]) {
                $path = urlencode($purl[path]);
                $urlencode = preg_replace("/".$path."/", "", $urlencode);
            }
            $outlogin_url = $g4[url].$urlencode;
        }
    }
    else {
        $outlogin_url = $g4[url];
    }
}
else {
    $outlogin_url = $urlencode;
}
?>

<link rel="stylesheet" href="<?=$outlogin_skin_path?>/style.css" type="text/css">
<style>
input#mb_id	{ background:url("<?=$outlogin_skin_path?>/img/icon_id.gif") no-repeat; background-position:5px; }
input#mb_password	{ background:url("<?=$outlogin_skin_path?>/img/icon_pswd.gif") no-repeat;  background-position:5px; }
</style>
<script type="text/javascript" src="<?=$g4[path]?>/js/capslock.js"></script>
<div id="zmb_outlogin_body">
<!-- 로그인 전 외부로그인 시작 -->
<form name="fhead" method="post" onsubmit="return fhead_submit(this);" autocomplete="off">
<input type="hidden" name="url" value="<?=$outlogin_url?>">
	<div class="zmb_login_always">
		<input type="checkbox" name="auto_login" id="auto_login" value="1" onclick="if(this.checked) { zm_alert('공공장소에서는 개인정보가 유출될 수 있으니 개인용 컴퓨터에서만 사용해 주세요.') }"><label for="auto_login"> 로그인 상태 유지</label>
	</div>
	<div id="zmb_login_info_box_left">
	<div class="zmb_login_input_box"><input name="mb_id" id="mb_id" type="text" class="zmb_login_input" size="12" maxlength="20" itemname="아이디" value=''></div>
	<div class="line"></div>
	<div id="pw" class="zmb_login_input_box"><input type="password" name="mb_password" id="mb_password" class="zmb_login_input" size="12" maxlength="20" value="" itemname="비밀번호" onKeyPress="check_capslock(event, 'outlogin_mb_password');"></div>
</div>
<div id="zmb_login_info_box_right">
	<input type="submit" value="로그인">
</div>

<div id="zmb_member_join">
	<span class="zmb_join_box">
		<a href="<?=$g4[bbs_path]?>/register.php"><b>회원가입</b></a>
	</span>
	<span class="zmb_join_box">
		<a href="<?=$g4[bbs_path]?>/zm.userinfo.php?pcd=idfind">아이디</a><a href="<?=$g4[bbs_path]?>/zm.userinfo.php?pcd=pwfind">·비밀번호 찾기</a>
	</span>
</div>
</form>
</div>

<script type="text/javascript">
function fhead_submit(f)
{
    if (!f.mb_id.value) {
        alert("회원아이디를 입력하십시오.");
        f.mb_id.focus();
        return false;
    }

    if (document.getElementById('pw').style.display!='none' && !f.mb_password.value) {
        alert("비밀번호를 입력하십시오.");
        f.mb_password.focus();
        return false;
    }

    <?
    if ($g4[https_url])
        echo "f.action = '$g4[https_url]/$g4[bbs]/login_check.php';";
    else
        echo "f.action = '$g4[bbs_path]/login_check.php';";
    ?>

    return true;
}
</script>
<!-- 로그인 전 외부로그인 끝 -->