'====================================================================
' ----取回密码----
' 2004-3-17 p9
'
'
'====================================================================
Dim Action
Action=SafeRequest("action",0)
Sub SavePwd()
Dim Question,UserName,Answer,NewPassword
UserName=Request.Form("UName")
Question=Request.Form("Question")
Answer=Request.Form("Answer")
NewPassword=Request.Form("Password")
If not ChkForm(UserName,1) then sysErr(6)
If not ChkForm(Question,1) then sysErr(6)
If not ChkForm(Answer,1) then sysErr(6)
If not ChkForm(NewPassword,1) then sysErr(6)
NewPassword=MD5(NewPassword)
Sql="SELECT ID,Answer,Question FROM NB_User WHERE Reg_Name='"&UserName&"'"
set rs=conn.execute(sql)
If Not rs.bof and not rs.eof then
If not Rs("Answer")=Answer Then
sysErr(3)
Else
Sql="Update NB_User Set Reg_Pass='"&NewPassword&"' Where Reg_Name='"&UserName&"'"
conn.execute(sql)
sysSus 3,""
End If
Else
sysErr(18)
End If
End Sub
%>
-> 取回密码
Select Case Action
Case "SavePwd"
SavePwd
Case "Change"
change
Case "View"
ViewQ
Case ""
Normal
End Select
'===========Step 1=========
Sub Normal()
Call NormalJS("document.reg.UName","请输入您的用户名")
%>
取回密码
4请输入用户名
*
End Sub
'==========Step 2==============
Sub ViewQ()
Dim Question,UserName
UserName=Request.Form("UName")
If not ChkForm(UserName,1) then sysErr(6)
Sql="SELECT id,Question FROM NB_User WHERE Reg_Name='"&UserName&"'"
Set rs=conn.execute(Sql)
If Not Rs.Eof And Not Rs.Bof Then
Question=rs(1)
Else
sysErr(18)
End If
set rs=nothing
Call NormalJS("document.reg.Answer","请输入您的答案")
%>
取回密码
4您的密码提示问题
4请输入答案
*[为了系统安全要求必须验证您的身份合法性]
End Sub
'=======Step 3=======
Sub Change()
Dim Question,Answer,UserName
UserName=Request.Form("UName")
Question=Request.Form("Question")
Answer=Request.Form("Answer")
If not ChkForm(UserName,1) then sysErr(6)
If not ChkForm(Question,1) then sysErr(6)
If not ChkForm(Answer,1) then sysErr(6)
Answer=MD5(Answer)
Sql="SELECT ID,Answer,Question FROM NB_User WHERE Reg_Name='"&UserName&"'"
set rs=conn.execute(sql)
If Not rs.bof and not rs.eof then
If not Rs("Answer")=Answer Then
sysErr(3)
End If
Else
sysErr(18)
End If
%>
var ie=(document.all)?true:false;
var Noac = false;
function readkey(){
if(ie){ if(window.event.keyCode==13){checkkey();}
}
}
function checkkey(){
if(document.reg.Password.value==''||document.reg.Password.value.length14){
alert("请填写您的新密码\n6-14个字符以内");
document.reg.Password.select();
}
else{
if(document.reg.RePassword.value!=document.reg.Password.value||document.reg.RePassword.value==''||document.reg.RePassword.value.length14){
alert("请再一次填写新密码\n必须与上面的密码相同");
document.reg.RePassword.select();
}
else{
Noac = true;
document.reg.submit();
}
}
}
取回密码
4请输入新的密码
*[6-14个字符.不能使用特殊字符]
4请再输入一遍新的密码
*[确认一遍您输入的密码]
End Sub
Sub NormalJS(Control,Msg)
%>
var ie=(document.all)?true:false;
var Noac = false;
function readkey(){
if(ie){ if(window.event.keyCode==13){checkkey();}
}
}
function checkkey(){
if(.value==''){
alert("");
.select();
}
else{
Noac = true;
document.reg.submit();
}
}