📄 changepwd.inc
字号:
<%
'************************************************************************************************
' 函数名 : Formchangepwd(sAccountid)
' 输 入 : sAccountid:用户名
' 输 出 : 提供修改用户密码的功能
' 功能描述: 提供当前用户的修改密码的功能
' 调用模块: changepwd.asp
' 作 者 : 蔡晓燕
' 日 期 : 2002-08-06
' 版 本 :
'************************************************************************************************
Function Formchangepwd(sAccountid)
'----------------------------------------------------------
' 根据用户名,显示相关用户的信息,提供修改密码的功能
'----------------------------------------------------------
dim sSQL, sTemp, sTempButtons, sAssociate, crs, rs, iRoleid
sSQL = "select * from T_account where account_id = "& Tosql(sAccountid,"text")
' response.write sSQL
' response.end
set crs = New CRecordset
set rs = crs.open(dbLocal,sSQL)
if not rs.eof then
iRoleid = crs.GetValue("role_id")
sTempButtons=_
" <img border=0 src=""../images/button/submit.gif"" style=""cursor:hand"" name=btnSubmit>" &_
" <img border=0 src=""../images/button/clear.gif"" style=""cursor:hand"" name=btnReset>" &_
" <img border=0 src=""../images/button/return.gif"" style=""cursor:hand"" name=btnReturn>"
else
response.write "<script language=""javascript"">alert('对不起,不存在该用户!')</script>"
response.write "<script language = vbscript>window.navigate(""changepwd.asp"")</script>"
end if
Formchangepwd=_
"<table cellspacing=0 cellpadding=0 width=600 align=center border=1>" & _
"<tr><td>"&_
TableTitle("修改用户密码", 600, "", "#0040a0") & _
"<table cellspacing=0 cellpadding=0 width=600 align=center border=0 class=tablelist>" & _
"<form name=""frmchangepwd"" method=post action=""changepwd.asp"">" &_
"<tr height=30>" & _
" <td width=200 class=tdlist align=right>用户名:</td>"&_
" <td width=400 class=tdlist >"&sAccountid&"</td>"& _
"</tr>" & _
"<tr height=30>" & _
" <td width=200 class=tdlist align=right>用户姓名:</td>"&_
" <td width=400 class=tdlist >"&TransEmpId(dbLocal,sAccountid)&"</td>"& _
"</tr>" & _
"<tr height=30>" & _
" <td width=200 class=tdlist align=right>请输入原密码:</td>"&_
" <td width=400 class=tdlist ><input type=password name=oldpwd size=30 maxlength=20></td>"& _
"</tr>" & _
"<tr height=30>" & _
" <td width=200 class=tdlist align=right>请输入新密码:</td>"&_
" <td width=400 class=tdlist ><input type=password name=newpwd1 size=30 maxlength=20></td>" & _
"</tr>" & _
"<tr height=30>" & _
" <td width=200 class=tdlist align=right>请确认新密码:</td>"&_
" <td width=400 class=tdlist ><input type=password name=newpwd2 size=30 maxlength=20></td>" & _
"</tr>" & _
"<tr height=30>" & _
" <td width=200 class=tdlist align=right>请注意:</td>"&_
" <td width=400 class=tdlist >密码由数字和字母组成。</td>" & _
"</tr>" & _
"<tr>" &_
" <input type=hidden name=accountid value="""&sAccountid&""">" & _
"</tr>"&_
"<tr height=50>" & _
" <td colspan=2 align=center>" & sTempButtons & _
" </td>" & _
"</tr>" & _
"</form>"&_
"</table>"&_
"</td></tr></table>"
End Function
'************************************************************************************************
' 函数名 : TableLink()
' 输 入 :
' 输 出 :
' 功能描述: 会议申请表页面上到其他页面的连接
' 调用模块: changepwd.asp
' 作 者 : 蔡晓燕
' 日 期 : 2002-07-11
' 版 本 :
'************************************************************************************************
Function TableLink()
TableLink = _
"<table width=600 cellspacing=0 cellpadding=0 border=0 align=center>" & _
"<tr height=30>" & _
" <td width=600><img src=""../images/bg/line.gif"" width=600 height=3></td>" & _
"</tr>" & _
"<tr height=30>" & _
" <td width=600> " & _
" <img src=""../images/goto.gif"" width=11 height=11> <a href=""changepwd.asp"">填写会议申请</a>" & _
" " & _
" <img src=""../images/goto.gif"" width=11 height=11> <a href=""list_checkmeeting.asp"">审批会议申请</a>" & _
" " & _
" <img src=""../images/goto.gif"" width=11 height=11> <a href=""list_rechangepwd.asp"">修改会议申请表</a></td>" & _
"</tr>" & _
"</table>"
End Function
'************************************************************************************************
' 函数名 : Updatechangepwd()
' 输 入 :
' 输 出 :
' 功能描述: 更新用户信息
' 调用模块: changepwd.asp
' 作 者 : 蔡晓燕
' 日 期 : 2002-08-02
' 版 本 :
'************************************************************************************************
Sub Updatechangepwd()
' 定义变量
dim sSQL, sError, crs, rs, sAccountid, sOldpwd, sNewpwd, sPwd
' 获取表单的数据
sAccountid = GetParam("accountid")
sOldpwd = GetParam("oldpwd")
sNewpwd = GetParam("newpwd1")
' response.write "changepwd of "&sAccountid
' 先判断输入的原密码是否正确
sSQL = "select * from t_account where account_id=" & Tosql(sAccountid,"text")
set crs = New CRecordset
set rs = crs.open(dbLocal,sSQL)
if not rs.eof then
sPwd = crs.GetValue("password")
else
Response.Write "<script language=""javascript"">alert('对不起,不存在该用户!')</script>"
response.write "<script language=vbscript>window.navigate(""changepwd.asp"")</script>"
end if
if sPwd = sOldpwd then
' 如果输入原密码正确,则修改密码为新密码
sSQL = "update t_account set password = " & Tosql(sNewpwd,"text") & "where account_id=" & Tosql(sAccountid,"text")
sError = ExecuteSQL(dbLocal, sSQL)
sSQL = "update t_email set password = " & Tosql(sNewpwd,"text") & "where userid=" & Tosql(sAccountid,"text")
sError = ExecuteSQL(dbLocal, sSQL)
if sError <> "" then
Response.Write "<script language=""javascript"">alert('对不起,用户密码修改出错,请查看数据库!')</script>"
else
iFlag = 1
Response.Write "<script language=""javascript"">alert('用户密码修改成功!')</script>"
end if
' response.write "<table cellspacing=0 cellpadding=0 width=600 align=center border=0>" & _
' "<tr height = 100><td><center><b>密码修改成功!</b></center>"&_
' "</td></tr>"
' response.end
else
Response.Write "<script language=""javascript"">alert('对不起,用户原密码输入有误!')</script>"
response.write "<script language=vbscript>window.navigate(""changepwd.asp"")</script>"
end if
' response.write "<script language=vbscript>window.navigate(""changepwd.asp"")</script>"
End Sub
function Formchanged()
formchanged = "<table cellspacing=0 cellpadding=0 width=600 align=center border=0>" & _
"<tr height = 30><td><center><b>密码修改成功!</b></center>"&_
"</td></tr>"&_
"<tr height=30>" & _
" <td colspan=2 align=center><img border=0 src=""../images/button/return.gif"" style=""cursor:hand"" name=btnReturn>"&_
" </td>" & _
"</tr></table>"
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -