📄 resetpassok.jsp
字号:
<%
/*##################################################################**
**# 项目名称:LyNews『凌云新闻』 #**
**# #**
**# 程序开发: teddy 『星语凌』 #**
**# #**
**# 版权所有: 凌云创作室 (原流星电脑工作室) #**
**# #**
**# 主页地址: http://www.lybbs.com #**
**# http://www.lybbs.net #**
**# 电邮地件: horseye@sina.com #**
**# #**
**##################################################################*/
%>
<%@include file="config.jsp"%>
<%@include file="getsession.jsp"%>
<%@page contentType="text/html;charset=GBK"%>
<%
ParameterUtils.setCharacterEncoding(request);
String password1 = ParameterUtils.getString(request,"password1");
String password2 = ParameterUtils.getString(request,"password2");
String password3 = ParameterUtils.getString(request,"password3");
String MD5Password1=(new MD5()).getMD5ofStr(password1);
String MD5Password2=(new MD5()).getMD5ofStr(password2);
if(password1.equals("") || password2.equals("") || password3.equals(""))
throw new Exception("请输入完整信息。");
else if(password2.length()<6)
throw new Exception("密码长度不能少于6位。");
else if(!password2.equals(password3))
throw new Exception("您两次输入的密码不一致。");
else if(password1.indexOf("\'")!=-1 || password1.indexOf("\"")!=-1 || password1.indexOf("*")!=-1 || password1.indexOf("\\")!=-1)
throw new Exception("密码不能包括 \' \" \\ * 等非法字符。");
else if(password2.indexOf("\'")!=-1 || password2.indexOf("\"")!=-1 || password2.indexOf("*")!=-1 || password2.indexOf("\\")!=-1)
throw new Exception("密码不能包括 \' \" \\ * 等非法字符。");
Factory factory = Factory.getInstance();
User user = factory.getUser();
UserFactory userFactory = factory.getUserFactory();
user.setUsername(sessionUser.getUsername());
user.setPassword(MD5Password1);
try{
user = userFactory.checkUser(user);
}
catch(Exception e) {
throw new Exception(e.getMessage());
}
user.setPassword(MD5Password2);
userFactory.resetPassword(user);
%>
<html>
<head>
<title>修改密码成功</title>
<link rel="stylesheet" href="../inc/admin.css" type="text/css">
</head>
<BODY leftmargin="0" bottommargin="0" rightmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="#DDEEFF">
<br>
<center>成功修改密码,请重新登陆。</center>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -