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

<!-- 로그인 시작 { -->
<div class="row mt-5">
  <div class="col-md-4">
  </div>
  <div class="col-md-4">
    <div class="card mt-5 mb-5 border-primary">
      <div class="card-header bg-primary text-white text-center"><h5><?php echo $g5['title'] ?></h5></div>

        <form name="flogin" action="<?php echo $login_action_url ?>" onsubmit="return flogin_submit(this);" method="post">
        <input type="hidden" name="url" value="<?php echo $login_url ?>">

        <div class="card-body">
          <div class="form-group has-danger">
              <label class="sr-only" for="login_id">회원아이디</label>
              <div class="input-group mb-2 mr-sm-2 mb-sm-0">
              <div class="input-group-addon" style="width: 2.6rem"><i class="fa fa-user"></i></div>
              <input type="text" name="mb_id" class="form-control" id="login_id" placeholder="아이디" required autofocus>
              </div>
          </div>

          <div class="form-group">
              <label class="sr-only" for="login_pw">비밀번호</label>
              <div class="input-group mb-2 mr-sm-2 mb-sm-0">
                <div class="input-group-addon" style="width: 2.6rem"><i class="fa fa-key"></i></div>
                <input type="password" name="mb_password" class="form-control" id="login_pw" placeholder="비밀번호" required>
              </div>
          </div>

          <div class="form-check mb-2 mr-sm-2 mb-sm-0">
              <label class="form-check-label">
                  <input class="form-check-input" name="auto_login" type="checkbox" >
                  <span style="padding-bottom: .15rem">자동로그인</span>
              </label>
          </div>
          <button type="submit" class="btn btn-success btn-block"><i class="fa fa-sign-in"></i> 로그인</button>
        </div>

        <?php
        // 소셜로그인 사용시 소셜로그인 버튼
        @include_once(get_social_skin_path().'/social_login.skin.php');
        ?>


        </form>
        <div class="card-footer text-center">
          <span><a href="<?php echo G5_BBS_URL ?>/password_lost.php" target="_blank" id="login_password_lost">아이디 비밀번호 찾기</a></span>
          <span class="ml-4"><a href="./register.php">회원 가입</a></span>
        </div>

    </div>
  </div>
  <div class="col-md-4">
  </div>
</div>
<script>
$(function(){
    $("#login_auto_login").click(function(){
        if (this.checked) {
            this.checked = confirm("자동로그인을 사용하시면 다음부터 회원아이디와 비밀번호를 입력하실 필요가 없습니다.\n\n공공장소에서는 개인정보가 유출될 수 있으니 사용을 자제하여 주십시오.\n\n자동로그인을 사용하시겠습니까?");
        }
    });
});

function flogin_submit(f)
{
    return true;
}
</script>
<!-- } 로그인 끝 -->
