📄 mustmodifypasswordstep1.jsp
字号:
<%@page contentType="text/html;charset=gb2312"%>
<%@ include file="incoming/Common.jsp"%>
<%
String loginmsg = request.getParameter("loginmsg");
String username = request.getParameter("username");
Integer pwdlenmax,pwdlenmin,pwdfrminnum,pwdfrminapha,pwdfrminspchar;
SysConfig sysconfig = SysConfig.FindByName("PwdLenMax");
pwdlenmax = Integer.valueOf(sysconfig.getSCValue());
sysconfig = SysConfig.FindByName("PwdLenMin");
pwdlenmin = Integer.valueOf(sysconfig.getSCValue());
sysconfig = SysConfig.FindByName("PwdFRMinNum");
pwdfrminnum = Integer.valueOf(sysconfig.getSCValue());
sysconfig = SysConfig.FindByName("PwdFRMinApha");
pwdfrminapha = Integer.valueOf(sysconfig.getSCValue());
sysconfig = SysConfig.FindByName("PwdFRMinSpChar");
pwdfrminspchar = Integer.valueOf(sysconfig.getSCValue());
%>
<HTML>
<HEAD>
<TITLE><%=title%></TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<link href="css/style.css" rel="stylesheet" type="text/css">
<script Language="JavaScript">
function isRightPwd(str)
{
var pwdlen=str.length;
if( (pwdlen < <%=pwdlenmin%>)||(pwdlen > <%=pwdlenmax%>) )
{
alert("密码长度不符合要求,长度必须大于或等于"+<%=pwdlenmin%>+",小于或等于"+<%=pwdlenmax%>)
return (false);
}
var pattern1 = /[0-9]/;
var pattern2 = /[a-z]/;
var pattern3 = /[A-Z]/;
var _pwdfrnum=0;
var _pwdfrapha=0;
var _pwdfrspchar=0;
for (i=0;i<pwdlen;i++)
{
if(pattern1.test(str.charAt(i)))
_pwdfrnum++;
else if( pattern2.test(str.charAt(i)) || pattern3.test(str.charAt(i)) )
_pwdfrapha++;
}
_pwdfrspchar = pwdlen - _pwdfrnum - _pwdfrapha;
if(<%=pwdfrminnum%> > _pwdfrnum)
{
alert("密码长度不符合要求,密码中最少含有数字字符"+<%=pwdfrminnum%>+"个");
return false;
}
if(<%=pwdfrminapha%> > _pwdfrapha)
{
alert("密码长度不符合要求,密码中最少含有字母字符"+<%=pwdfrminapha%>+"个");
return false;
}
if(<%=pwdfrminspchar%> > _pwdfrspchar)
{
alert("密码长度不符合要求,密码中最少含有特殊字符"+<%=pwdfrminspchar%>+"个");
return false;
}
return true;
}
function check_input(theForm)
{
if(theForm.username.value=="")
{
alert("请输入用户名.");
theForm.username.focus();
return (false);
}
if(theForm.oldpassword.value=="")
{
alert("请输入旧密码.");
theForm.oldpassword.focus();
return (false);
}
if(theForm.newpassword.value=="")
{
alert("请输入新密码.");
theForm.newpassword.focus();
return (false);
}
if(!isRightPwd(theForm.newpassword.value))
{
theForm.newpassword.focus();
return (false);
}
if (theForm.newpassword.value == theForm.oldpassword.value)
{
alert("新密码必须与旧密码不同.");
theForm.newpassword.focus();
return (false);
}
if (theForm.newpassword.value != theForm.confirmpassword.value)
{
alert("新密码和确认密码不一致.");
theForm.confirmpassword.focus();
return (false);
}
}
</script>
</head>
<body>
<p> </p>
<table width="382" height="197" border="2" align="center" cellpadding="2" cellspacing="2" bordercolor="#878080">
<tr>
<td width="368" height="189"><div align="center">
<table border=0 cellpadding=0 cellspacing=0 background="images/login_bg.jpg" bgcolor="#FFFFFF" class=bg>
<form method="post" name="form1" action="MustModifyPasswordStep2.jsp" onsubmit="return check_input(this)">
<tr> </tr>
<tr>
<td align=center valign=top><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center" class="title1">修改密码</div><br></td>
</tr>
<tr>
<td height="2" bgcolor="#999999"></td>
</tr>
</table>
<table width=319 border=0 cellspacing=0 cellpadding=0>
<input type=hidden name=url value="">
<tr>
<td width="143" height=29><div align="right"><strong> 用户名: </strong> </div></td>
<td width="176" height=29><input name=username class=data size=24 maxlength=16 value="<%=username%>" readonly="true"></td>
</tr>
<tr>
<td height=29><div align="right"><strong>旧密码: </strong> </div></td>
<td height=29><input name=oldpassword type="password" class=data id="oldpassword" value="" size=24 maxlength=16></td>
</tr>
<tr>
<td height=29><div align="right"><strong>新密码:</strong></div></td>
<td height=29><input name=newpassword type="password" class=data id="newpassword" value="" size=24 maxlength=16></td>
</tr>
<tr>
<td height=29> <div align="right"><strong> 确认密码: </strong> </div></td>
<td height=29><input name=confirmpassword type=password class=data id="confirmpassword" size=24 maxlength=16></td>
</tr>
<tr>
<td height="41" colspan="2" align=right><div align="center"><font color=fe8c14>
</font><font color=fe8c14>
<input name="submit" type=submit value="修改" class=button>
<input name=reset type=reset class=button id="reset2" value="取消">
</font></div></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" >
<table width="100%" height="36%" cellpadding="0" cellspacing="0">
<tr>
<td height="5"><img src="images/login_line.gif" width="366" height="4"></td>
</tr>
<tr>
<td height="37" align="center"> <font color="#CC0000">
<%
if(loginmsg != null && loginmsg.equals("passwordwrong"))
out.print("旧密码输入错误.");
%>
</font></td>
</tr>
</table>
</td>
</tr>
</form>
</table>
</div></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -