<%@ page contentType="text/html; charset=euc-kr"  %>
<jsp:directive.page import="org.kldp.ebmsh.moniter.persistant.EbmsMoniterManager"/>

<jsp:directive.page import="org.kldp.ebmsh.moniter.permission.PermissionManager"/>

<jsp:directive.page import="org.kldp.ebmsh.moniter.permission.PermissionManager"/>
<jsp:directive.page import="org.kldp.ebmsh.config.EbmsConstants"/>

<%@ include file="/authorize/loginCheck.jsp" %>

<%@ include file="/setup/setupCheck.jsp" %>

<%
	String id = request.getParameter("id");
	String oldPassword = request.getParameter("oldPassword");
	String newPassword = request.getParameter("newPassword");
	
	EbmsMoniterManager manager = new EbmsMoniterManager();
	
	if( manager.authorizeAdmin(id, oldPassword) ) 
		manager.updateAdminPassword(id, newPassword);
	else {
%>
		<script language="JavaScript">
			alert('기존 비밀번호가 일치하지 않습니다.');
			
			history.go(-1);
		</script>
<%
	}
%>

<script language="JavaScript">
	alert('비밀번호가 변경되었습니다.');
	
	window.close();
</script>