⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modify_pwd.jsp

📁 计算机技术的快速发展
💻 JSP
字号:
<%@page contentType="text/html; charset=gb2312" language="java" errorPage="error.jsp"%>
<%@page import="com.suninformation.*,com.suninformation.user.*,com.suninformation.tools.*"%>
<%request.setCharacterEncoding("gb2312");%>
<html>
<head>
<title>修改密码 - 沈航网络</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Includes/user.css" rel="stylesheet" type="text/css">
<style type="text/css">
  <!--
    body {
    background-image: url(Images/bg.jpg);
    }
    body,td,th {
    font-size: 12px;
    }
  -->
</style>
<link href="Includes/im.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#ffffff">
<%
  String UserName = ParamUtils.getParameter(request, "username");
  String sessionUserName = (String) session.getAttribute("userName");
  boolean errorLogin = true;
  String errMsg = "<ui>";
  boolean ModifyPwd = ParamUtils.getBooleanParameter(request, "modifypwd", false);
  String OldPassword = null;
  String NewPassword = null;
  String NewPassword2 = null;
  boolean errorOldPassword = false;
  boolean errorNewPassword = false;
  boolean errorNewPassword2 = false;
  boolean errorPasswordMatch = false;
  boolean errors = false;
  boolean succ = false;
  //用户是否登陆了。{
  if ("null".equals(UserName)) {
    UserName = null;
  }
  if (UserName != null && sessionUserName != null) {
    if (UserName.equals(sessionUserName)) {
      errorLogin = false;
    }
    else {
      errorLogin = true;
    }
  }
  if (errorLogin) {
    throw new UserNotFoundException("): Sorry,您可能还未登陆或已经超时了!<br>请重新<a href=\"login.jsp\">登陆</a>。");
  }
  //页面处理部分
  if (!errorLogin && ModifyPwd && request.getMethod().equals("POST")) {
    OldPassword = ParamUtils.getParameter(request, "oldpassword");
    NewPassword = ParamUtils.getParameter(request, "newpassword");
    NewPassword2 = ParamUtils.getParameter(request, "newpassword2");
    if (OldPassword == null) {
      errorOldPassword = true;
    }
    if (NewPassword == null || NewPassword.length() < 6 || NewPassword.length() > 16) {
      errorNewPassword = true;
    }
    if (NewPassword2 == null || NewPassword2.length() < 6 || NewPassword2.length() > 16) {
      errorNewPassword2 = true;
    }
    if (!errorNewPassword && !errorNewPassword2) {
      if (!NewPassword.equals(NewPassword2)) {
        errorPasswordMatch = true;
      }
    }
    errors = errorOldPassword || errorNewPassword || errorNewPassword2 || errorPasswordMatch;
    if (!errors) {
      try {
        User us = UserManager.getUserProxy().getUser(UserName);
        if(CheckValue.md5(OldPassword).equals(us.getPassword())) {
          us.setPassword(NewPassword2);
		  us.save();
          succ = true;
        }else {
          throw new UnacceptableException("旧密码不正确。");
        }
      }
      catch (UserNotFoundException e) {
        throw new UserNotFoundException("该用户不存在。");
      }
    }
    if (errors) {
      if (errorOldPassword || errorNewPassword || errorNewPassword2) {
        errMsg = errMsg + "<li>表单填写有误,请重新输入。</li>";
      }else if (errorPasswordMatch) {
        errMsg = errMsg + "<li>重复密码与密码不一致。</li>";
      }
      errMsg = errMsg + "</ui>";
      throw new UnacceptableException(errMsg);
    }
  }
%>
<TABLE WIDTH=776 BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>
  <TR>
    <TD width="10" ROWSPAN=2>&nbsp;</TD>
    <TD><IMG SRC="Images/WEB_Page1_14.jpg" WIDTH=766 HEIGHT=9 ALT=""></TD>
  </TR>
  <TR>
    <TD background="Images/WEB_Page1_15.jpg"><table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="3" align="right"><font color="#747474"><a href="http://www.aoke2008.com" class="title">沈航首页</a>| <a href="#" class="title" onClick="JavaScript:window.external.addFavorite('http://www.aoke2008.com/','奥克资讯网');return false;">加入收藏</a> | <a href="#" class="title" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.aoke2008.com/')">设为首页</a> | 网站导航</font></td>
          <td width="29">&nbsp;</td>
        </tr>
        <tr>
          <td width="19" valign="top">&nbsp;</td>
          <td width="192" valign="top"><img src="Images/111.jpg" width="188" height="73"><br>
          </td>
          <td width="526" valign="baseline"><table width="100%"  border="0" align="center" cellpadding="1" cellspacing="1">
              <tr>
                <td align="center"><a href="main.jsp?username=<%=UserName%>" class="title">个人帐户中心</a> - <a href="show_person_info.jsp?username=<%=UserName%>" class="title">显示个人信息</a> - <a href="modify_person_info.jsp?username=<%=UserName%>" class="title">修改个人信息</a> - <a href="modify_pwd.jsp?username=<%=UserName%>" class="title">修改密码</a> - <a href="setup_security_info.jsp?username=<%=UserName%>" class="title">安全设置</a> - <a href="<%=SunGlobal.getHelpHome()%>" class="title">用户手册</a> - <a href="logout.jsp" class="title">退出系统</a></td>
              </tr>
          </table></td>
          <td valign="top">&nbsp;</td>
        </tr>
    </table></TD>
  </TR>
</table>
<TABLE WIDTH=776 BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>
  <TR>
    <TD width="10" ROWSPAN=2>&nbsp;</TD>
    <TD><IMG SRC="Images/WEB_Page1_14.jpg" WIDTH=766 HEIGHT=9 ALT=""></TD>
  </TR>
  <TR>
    <TD background="Images/WEB_Page1_15.jpg">
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="2">&nbsp;</td>
          <td width="29">&nbsp;</td>
        </tr>
        <tr>
          <td width="17" height="159" valign="top">&nbsp;</td>
          <td width="720" align="center" valign="top">
            <table width="555" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="555" align="center">
                <%if (!succ) {%>
                  <br>
                  <table width="61%" border="0" cellspacing="1" cellpadding="1">
                    <tr>
                      <td width="9%" class="td_downLine">&nbsp;</td>
                      <td width="91%" class="td_downLine">
                        <img src="Images/arrow_04.gif" width="7" height="7">
                        请认真填写下列信息,然后点击“确定”按钮。
                        <br>
                      </td>
                    </tr>
                  </table>
                  <table width="61%" border="0" align="center" cellpadding="1" cellspacing="1">
                  <form action="" method="post" name="frmModifyPwd" id="frmModifyPwd">
                    <tr>
                      <td width="28%" height="30" align="right" class="td_downLine">旧密码:</td>
                      <td width="72%" class="td_downLine">
                        <input name="oldpassword" type="password" id="question2" style="FONT-SIZE: 12px; WIDTH: 150px" maxlength="16">
                      </td>
                    </tr>
                    <tr>
                      <td height="30" align="right" class="td_downLine">新密码:</td>
                      <td class="td_downLine">
                        <input name="newpassword" type="password" id="answer3" style="FONT-SIZE: 12px; WIDTH: 150px" maxlength="16">
                      </td>
                    </tr>
                    <tr>
                      <td height="30" align="right" class="td_downLine">确认新密码:</td>
                      <td class="td_downLine">
                        <input name="newpassword2" type="password" id="newpassword2" style="FONT-SIZE: 12px; WIDTH: 150px" maxlength="16">                        </td>
                    </tr>
                    <tr>
                      <td height="30">
                        <input name="modifypwd" type="hidden" id="modifypwd" value="true">
                      </td>
                      <td>
                        <input name="btn_modifypwd" type="submit" id="btn_modifypwd" style="FONT-SIZE: 12px; WIDTH: 80px" value="确定">
                        <input name="btn_modifypwd" type="reset" id="btn_modifypwd" style="FONT-SIZE: 12px; WIDTH: 60px" value="重填">
                      </td>
                    </tr>
                  </form>
                  </table>
                  <br>
                <%} else {%>
                  <table width="74%"  border="0" cellpadding="1" cellspacing="1">
                    <tr>
                      <td width="2%" height="22" class="td_downLine">&nbsp;</td>
                      <td width="74%" class="td_downLine"> &nbsp;<img src="Images/arrow_04.gif" width="7" height="7"> <strong>系统消息:</strong></td>
                      <td width="24%" class="td_downLine">&nbsp;</td>
                    </tr>
                    <tr>
                      <td class="td_downLine">&nbsp; </td>
                      <td class="td_downLine"><p>密码修改完成!现在您可以:</p>
                          <ul>
                            <li><a href="main.jsp?username=<%=UserName%>">返回PersonHome!</a></li>
                        </ul></td>
                      <td valign="top" class="td_downLine"><img src="Images/succ.gif" width="95" height="97"></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td align="center">&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                  </table>
                  <%}%>
                </td>
              </tr>
            </table>
          <br></td>
          <td valign="top">&nbsp;</td>
        </tr>
      </table>
    </TD>
  </TR>
</table>
<TABLE WIDTH=776 BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>
  <TR>
    <TD width="10" ROWSPAN=3>&nbsp;</TD>
    <TD><IMG SRC="Images/WEB_Page1_14.jpg" WIDTH=766 HEIGHT=9 ALT=""></TD>
  </TR>
  <TR>
    <TD background="Images/WEB_Page1_15.jpg"><table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td colspan="2">&nbsp;</td>
          <td width="29">&nbsp;</td>
        </tr>
        <tr>
          <td width="17" valign="top">&nbsp;</td>
          <td width="720" align="center" valign="top"><font color="#b1b1b1"><a href="../about_aoke_cn.htm" class="title">关于沈航</a></font> <font color="#b1b1b1">|</font> <font color="#b1b1b1">服务条款</font> <font color="#b1b1b1">|</font> <font color="#b1b1b1">广告服务</font> <font color="#b1b1b1">|</font> <font color="#b1b1b1">沈航招聘</font> <font color="#b1b1b1">|</font> <font color="#b1b1b1">客服中心</font> <font color="#b1b1b1">|</font> <font color="#b1b1b1">联系我们</font><font style="font-size: 12px; line-height: 24px;" color="#b2b2b2"><br>
           <br>
            沈阳航空工业学院&nbsp;版权所有</font></td>
          <td valign="top">&nbsp;</td>
        </tr>
    </table></TD>
  </TR>
  <TR>
    <TD><IMG SRC="Images/WEB_Page1_17.jpg" WIDTH=766 HEIGHT=22 ALT=""> </TD>
  </TR>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -