📄 admin_modifypwd.asp
字号:
<!--#include file="Inc/Const.asp"-->
<!--#include file="../inc/Cl_Md5.asp"-->
<%
if Not Cl.TrueOtherPurview("modifypwd") then
Cl.ShowErr("<br /><li>您无此操作权限!</li>")
end if
dim Action
Action=Trim(request("Action"))
%>
<html>
<head>
<title>修改管理员密码(<%=Cl.Admin_Info(1)%>)</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../Skins/Css/Admin.Css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript">
function check()
{
if(document.form1.OldPassword.value=="")
{
alert("原密码不能为空!");
document.form1.OldPassword.focus();
return false;
}
if(document.form1.Password.value=="")
{
alert("密码不能为空!");
document.form1.Password.focus();
return false;
}
if((document.form1.Password.value)!=(document.form1.PwdConfirm.value))
{
alert("初始密码与确认密码不同!");
document.form1.PwdConfirm.select();
document.form1.PwdConfirm.focus();
return false;
}
}
</script>
</head>
<body>
<%
if Action="Modify" then
call ModifyPwd()
else
call main()
end if
if FoundErr=True then Cl.ShowErr(ErrMsg)
CloseAllObj
%>
</body>
</html>
<%
Sub ModifyPwd()
dim OldPassword,password,PwdConfirm
OldPassword=Trim(Request("OldPassword"))
password=Trim(Request("Password"))
PwdConfirm=Trim(request("PwdConfirm"))
if OldPassword="" or password="" then
FoundErr=True
ErrMsg=ErrMsg & "<br /><li>原密码或新密码不能为空!</li>"
exit sub
end if
if PwdConfirm<>Password then
FoundErr=True
ErrMsg=ErrMsg & "<br /><li>确认密码必须与新密码相同!</li>"
exit sub
end if
dim RsAdmin
Set RsAdmin=Server.CreateObject("ADODB.Recordset")
OpenConn : RsAdmin.Open "Select * from Cl_Admin where ID="&Clng(Cl.Admin_Info(0))&" and PassWord='"&Md5(OldPassword,16)&"'",Conn,1,3
if RsAdmin.bof and RsAdmin.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br /><li>原密码错误!</li>"
exit sub
end if
RsAdmin("PassWord")=md5(password,16)
RsAdmin.Update
RsAdmin.Close:Set RsAdmin=Nothing
Cl.SaveAdminLog
Call Cl.ShowSuc("修改密码成功,请重新用新密码登录后台!")
End Sub
Sub main()
%>
<table border="0" align="center" cellpadding="0" cellspacing="1" class="border">
<form method="post" action="Admin_ModifyPwd.asp" name="form1" onsubmit="javascript:return check();">
<tr class="title">
<td colspan="2"> <div align="center"><strong>修 改 管 理 员 密 码</strong>(<%=Cl.Admin_Info(1)%>)</div></td>
</tr>
<tr>
<td width="100" align="right" class="tdbg"><strong>用 户 名:</strong></td>
<td class="tdbg"><%=Cl.Admin_Info(1)%></td>
</tr>
<tr>
<td width="100" align="right" class="tdbg"><strong>原 密 码:</strong></td>
<td class="tdbg"><input type="password" name="OldPassword"> </td>
</tr>
<tr>
<td width="100" align="right" class="tdbg"><strong>新 密 码:</strong></td>
<td class="tdbg"><input type="password" name="Password"> </td>
</tr>
<tr>
<td width="100" align="right" class="tdbg"><strong>确认密码:</strong></td>
<td class="tdbg"><input type="password" name="PwdConfirm"> </td>
</tr>
<tr>
<td height="40" colspan="2" align="center" class="tdbg"><input name="Action" type="hidden" id="Action" value="Modify">
<input type="submit" name="Submit" value=" 确 定 " style="cursor:hand;">
<input name="Cancel" type="button" id="Cancel" value=" 取 消 " onClick="window.location.href='Admin_Index.asp?action=admin_main'" style="cursor:hand;"></td>
</tr>
</form>
</table>
<%
End Sub
%>
<%
'<!--
'┌───────────────────────────────────────────────────────┐
'│ │
'│ CreateLive CMS Version 4.0 │
'│ Powered by Aspoo.CN │
'│ │
'│ 邮箱: support@aspoo.cn Info@aspoo.cn │
'│ QQ: 3315263 596197794 │
'│ 网站: www.aspoo.cn www.aspoo.com │
'│ 论坛: bbs.aspoo.cn bbs.aspoo.com │
'│ │
'│ Copyright (C) 2005-2007 Aspoo.CN All Rights Reserved. │
'└───────────────────────────────────────────────────────┘
'-->
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -