<%
/************************************************************@@
  * Program Name	: multiCheck.jsp
  * Description		: 로그인
  * Author				: 구경모
  * Create Date		: 2008.1.23
  * History				: 한명의 유저가 여러가지 부서에 속해있을때 확인후 셀렉트를 함.
@@************************************************************/
%>
<%@ page contentType="text/html; charset=UTF-8"
    import="java.util.Set"
	import="javax.jdo.PersistenceManager"
    import="javax.jdo.Transaction"
	import="javax.jdo.JDOObjectNotFoundException"
	import="org.slf4j.Logger"
    import="org.slf4j.LoggerFactory"
	import="kr.co.kihyun.moumi.Moumi"
	import="kr.co.kihyun.beans.entity.MUser"
	import="kr.co.kihyun.beans.entity.MDept"
	import="kr.co.kihyun.beans.entity.util.*"
	import="kr.co.kihyun.beans.entity.util.MPersistenceManager"
	import="kr.co.kihyun.lang.MString"
	import="kr.co.kihyun.beans.user.User"
	import="kr.co.kihyun.beans.user.HttpSSOLogin"
	import="kr.co.kihyun.lang.Encoder"
    import="javax.servlet.http.HttpServlet"
    import="javax.servlet.http.HttpSession"
    import="kr.co.kihyun.beans.user.MultiCheck"%>
 <%
	request.setCharacterEncoding("UTF-8");

	String id=request.getParameter("id");
	String password=request.getParameter("password");
//	MultiCheck mc = new MultiCheck();
//    mc.IdCheck(id);
//    int tmpCount = mc.getCount();

//    if(tmpCount!=0){
		//String[] str=mc.getDeptID();
//        String[] str=mc.getDeptID();
//		if(str.length>1){
  %>
	<form name='f' method='post'>
				<input type="hidden" name="id" value="<%=id%>">
				<input type="hidden" name="password" value=<%=password%>>
	</form>
	<form name="login" action="/servlet/kr.co.kihyun.beans.user.HttpSSOLogin" method="post">
				<!-- input type="hidden" name="deptID" value=""> -->
				<input type="hidden" name="id" value="<%=id%>">
				<input type="hidden" name="password" value=<%=password%>>
	</form>
 	<script>
				login.submit();
	</script>
   <%--
		}else{
   %>
    <form name='f' method='post'>
				<input type="hidden" name="id" value="<%=id%>">
				<input type="hidden" name="password" value=<%=password%>>
	</form>
	<form name="login" action="/servlet/kr.co.kihyun.beans.user.HttpSSOLogin" method="post">
				<input type="hidden" name="id" value="<%=id%>">
				<input type="hidden" name="deptID" value="<%=str[0]%>">
				<input type="hidden" name="password" value=<%=password%>>
	</form>
	<script>
	window.open("/totsys/login/popup_dept.jsp", "pop_dept", "width=300 ,height=250 ,toolbar=no, directories=no, status=no, menubar=no, resizable=no");
				document.f.action="/totsys/login/popup_dept.jsp";
				document.f.target="pop_dept";
				document.f.submit();

	</script>
	<%
		}
     }else{
	%>
		<script>
			alert("존재하지않는 아이디 또는 비밀번호가 일치하지 않습니다.");
			location.href="/totsys/login/login.jsp";
		</script>
	<%
        }
--%>
