
<%
/**********************************************************************************
	프로그램명		: dept_view.jsp
	프로그램설명	:
	작 성 자			: 기현테크
	작 성 일			: 2010.11.28
	최신변경일		:
***********************************************************************************/
%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="kr.co.kihyun.beans.user.HttpSSOLogin"%>
<%@ page import="kr.co.kihyun.text.html.ServletUtil"%>
<%@ page import="kr.co.kihyun.lang.Encoder"%>
<%@ page import="kr.co.kihyun.moumi.MoumiConfig"%>
<%@ page import="kr.co.kihyun.lang.MString"%>
<%@ page import="kr.co.kihyun.beans.user.User"%>
<%@ page import="kr.co.kihyun.beans.entity.MDept"%>
<%@ page import="java.net.URLEncoder"%>
<%@page import="java.net.URLDecoder"
	import="javax.jdo.PersistenceManager" import="javax.jdo.Transaction"
	import="kr.co.kihyun.beans.entity.util.*"
	import="kr.co.kihyun.beans.entity.*"
%>

<%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%>

<%
	PersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager());
	Transaction tx = pm.currentTransaction();
	try{
		request.setCharacterEncoding("UTF-8");
        /***** user Login check *****************/
		if(!HttpSSOLogin.isLogin(request)){
			String connURL="parent.location='/totsys/login/login.jsp';";
			out.println(ServletUtil.getJavaScript(connURL));
			return;
		}

		/********** session내의 userId **********/
		String usID = HttpSSOLogin.getLoginID(request);
		/****** Parameter ******/
		String userID = clearXSS(URLDecoder.decode(request.getParameter("userID"), "UTF-8"),"");
        String phone = clearXSS(URLDecoder.decode(request.getParameter("phone"), "UTF-8"),"");

		tx.begin();

		MUser mUser = pm.getObjectById(MUser.class, userID);
		SysAuth sysAuth = mUser.getSysAuth();

		tx.rollback();			
%>
<HTML>
<HEAD>
<TITLE><%=MoumiConfig.getTitle()%></TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<link rel="stylesheet" href="/totsys/common/css/text.css"
	type="text/css">
<link rel="stylesheet" href="/totsys/common/css/kecttep.css"
	type="text/css">
<link rel="stylesheet" href="/totsys/common/css/SquareButtons.css"
	type="text/css">
<script src="/totsys/common/js/rollover.js"></script>
<SCRIPT language="javascript">
			function userDel(){
				if (confirm("<%=MoumiConfig.getMessageBundle().getString("moumi.message.popup.deletion")%>")) 
				{
					location.href='/servlet/kr.co.kihyun.beans.totsys.sysadm.user.HttpUserDeleter?userID=<%=URLEncoder.encode(userID, "UTF-8")%>';
				}
			}
           function userModify(){
				if (confirm("<%=MoumiConfig.getMessageBundle().getString("moumi.message.button.formModify")%>"))
				{
					location.href='/servlet/kr.co.kihyun.beans.user.HttpUserModify?userID=<%=URLEncoder.encode(userID, "UTF-8")%>&phone=<%=URLEncoder.encode(phone, "UTF-8")%>';
				}
			}
		</SCRIPT>
<style>
td {
	padding: 2 3 2 3;
}
</style>
</HEAD>

<body style='' BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0
	MARGINHEIGHT=0>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr class="toolbar">
		<td align="right">
		<table border="0" cellspacing="0" cellpadding="0">
			<tr>
                <td><a class="simplebutton" href="#"
					onclick="<% if(!MString.isNull(userID) && SysAuth.TOTPER == sysAuth) {%>userModify();<%}%>"><span
					class="no"><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.user")%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.change")%></span></a></td>
				<td><a class="simplebutton" href="#"
					onclick="<% if(!MString.isNull(userID) && SysAuth.TOTPER == sysAuth) {%>userDel();<%}%>"><span
					class="no"><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.user")%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_report.delete")%></span></a></td>
			</tr>
		</table>
		</td>
	</tr>
</table>
</BODY>
</HTML>
<%
	}catch(Exception ex){
                //38.오류메세지를 통한 정보 노출(getMessage)_CWE-209 : Update by YOUNGJUN,CHO
		ex.printStackTrace();
		//out.println(ex);
		//out.println("<html><body style='overflow=auto' bgcolor='white'><h1>Can't contact servlet runner</h1><br><br> Message : "+ex.getMessage()+"</body></html>");
		//out.println("<META HTTP-EQUIV='refresh' CONTENT='0.1 URL=/error/exception.jsp'>");
                //================================================
	}finally{
		if(tx.isActive())
			tx.rollback();
		pm.close();
	}
%>
