<%@ page contentType="text/html; charset=GB2312" %>
<%@page import="zr.zrpower.entity.sys.SessionUser"%>
<%@page import="zr.zrpower.ejb.sys.UIService"%>
<%@page import="zr.zrpower.ejb.sys.UserService" %>

<%@page import="java.lang.Object"%>
<%@ page import="java.io.*,java.text.*,java.util.*" %>
<HTML>
<%
  SessionUser user = (SessionUser) session.getAttribute("userinfo");
  UserService userService=new UserService();
  UIService userUI = new UIService();

%>
<HTML>
<HEAD>
<TITLE></TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<link REL="stylesheet" type="text/css" href="../../../zrsysmanage/css/<%=user.getUserCSS()%>"></HEAD>

<BODY class="BodyMain">


<br>

<div align="center" style="font-size:18px;">
<font color=red>
<%
request.setCharacterEncoding("GBK");
response.setContentType("text/html; charset=GBK");

String  strType=request.getParameter("Type");
String  strOldPwd=request.getParameter("OldPwd");
String strNewPwd=request.getParameter("NewPwd1");
String  strOldRemarkPwd=request.getParameter("OldRemarkPwd");
String strNewRemarkPwd=request.getParameter("NewRemarkPwd1");
if(strType.equals("User")){
  if(!userService.CheckPw(user.getUserID(),strOldPwd))
  {
    out.println("您所输入的原密码不正确，请重新输入！");
  }
  else
  {
    try
    {
      userService.ResetPassword(user.getUserID(),strNewPwd);
      out.println("修改密码成功！");
    }
    catch (Exception ex) {
      out.println("密码修改失败，请联系系统管理员！<br>"+ex.toString());
    }
  }
}

%>
</font>

<br>
<br>
 <center><br>
                 <table cellspacing="0" cellpadding="0" border='0'><tr>
  <%=userUI.ClickButton("返 回","JavaScript:history.back();","buttonReturn.gif",user.getUserImage())%>
  </tr></table>
                 </center>
</div>


</BODY>
</HTML>
<%
//清空相关对象
user = null;
userUI = null;
userService = null;
%>
