📄 admin_admin_edit.asp
字号:
<!--#include file="mdb.asp"-->
<%
if session("adminlogin")<>sessionvar then
Response.Write("<script language=javascript>alert('你尚未登录,或者超时了!请重新登录');this.location.href='admin_login.asp';</script>")
Response.End
End if
dim id,username,password,level
dim pw1,pw2,pw3,pw4,pw5
id=Trim(request("id"))
if id="" then
Call outcome("非法操作")
Response.End
end if
if Session("level")>2 then
sql="select * from O3888_admin where id="&id
set rs=conn.execute(sql)
if rs.bof and rs.eof then
rs.close
set rs=nothing
Call outcome("非法操作")
Response.End
else
username=rs("username")
password=rs("password")
level=rs("level")
rs.close
set rs=nothing
end if
if request("action")="doit" then
if request("pw1")="" and request("pw2")="" and request("pw3")="" and request("pw4")="" then
pw5=ReplaceBadChar(Trim(request("pw5")))
if Cstr(pw5)=Cstr(level) then
Call outcome("请输入请你要修改的对象")
Response.End
end if
set r=server.createobject("adodb.recordset")
r.open "select * from O3888_admin where id="&id,conn,1,3
if not r.eof then
r("level")=pw5
r.update
r.close
set r=nothing
Call outcome("管理员权限已修改")
Response.End
else
r.close
set r=nothing
Call outcome("非法操作")
Response.End
end if
end if
if Trim(request("pw4"))="" then
Call outcome("请输入原密码")
Response.End
end if
if Cstr(md5(Trim(request("pw4"))))<>Cstr(password) then
Call outcome("原密码输入错误")
Response.End
end if
if cstr(username)<>cstr(request("pw3")) then
set rs=server.createobject("adodb.recordset")
rs.open "select * from O3888_admin where username='"&request("pw3")&"'",conn,1,3
if rs.eof and rs.bof then
rs.close
set rs=nothing
else
rs.close
set rs=nothing
Call outcome("该帐号已经存在")
Response.End
end if
end if
if Trim(request("pw1"))<>Trim(request("pw2")) then
Call outcome("两次输入的密码不一样")
Response.End
end if
if Trim(request("pw3"))="" then
pw3=username
else
pw3=ReplaceBadChar(Trim(request("pw3")))
end if
if Trim(request("pw1"))="" then
pw1=password
else
pw1=md5(ReplaceBadChar(Trim(request("pw1"))))
end if
if Trim(request("pw5"))="" then
pw5=level
else
pw5=ReplaceBadChar(Trim(request("pw5")))
end if
set r=server.createobject("adodb.recordset")
r.open "select * from O3888_admin where id="&id,conn,1,3
if not r.eof then
r("username")=pw3
r("password")=pw1
r("level")=pw5
r.update
r.close
set r=nothing
Call outcome("管理员信息已成功更改")
Response.End
else
r.close
set r=nothing
Call outcome("非法操作")
Response.End
end if
end if
%>
<html>
<head>
<title>修改管理员信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK REL="stylesheet" HREF="css.css" TYPE="text/css">
</head>
<body>
<table width="96%" border="0" cellspacing="1" cellpadding="8" align="center" class="b">
<tr>
<td align="center">更改当前管理员信息</td>
</tr></table>
<table width="96%" border="0" cellspacing="1" cellpadding="8" align="center" class="a">
<form action="admin_admin_edit.asp?id=<%=id%>" method="post">
<tr>
<td width="20%"><br>原管理员帐号:</td>
<td width="80%"><input class="c" type="username" name="0" value=<%=username%> disabled></td>
</tr>
<tr>
<td>请输入原密码:</td>
<td><input class="c" type="password" name="pw4"> <font color="red">*</font></td>
</tr>
<tr>
<td>新的管理员权限</td>
<td>
<select name="pw5" class="c">
<option <%if level=9 then response.write "selected" else response.write "" end if%> value="9">高级管理员</option>
<option <%if level=1 then response.write "selected" else response.write "" end if%> value="1">普通管理员</option>
</select>
</td>
</tr>
<tr>
<td width="100">新管理员帐号:</td>
<td><input class="c" type="username" name="pw3"> <font color="red">如不修改,请留空</font></td>
</tr>
<tr>
<td>请输入新密码:</td>
<td><input class="c" type="password" name="pw1"> <font color="red">如不修改,请留空</font></td>
</tr>
<tr>
<td>请确认新密码:</td>
<td><input class="c" type="password" name="pw2"> <font color="red">如不修改,请留空</font></td>
</tr>
<tr>
<td></td>
<td><input class="d" type="submit"></td>
</tr>
<tr>
<td colspan="2"><font color="red">说明:如果你只想修改管理员权限,请选择后直接点“提交查询内容“(只限高级管理员,无需原密码)。</font></td>
<tr>
<td align="center" colspan="2">[<a href="http://www.03888.com/" target="_blank">03888网址大全</a>]</td>
</tr>
</table>
<input type="hidden" value="doit" name="action">
</form>
</body>
</html>
<%
end if
if Session("level")<2 then
if Cstr(id)<>Cstr(Session("adminid")) then
Call outcome("权限不足")
Response.End
end if
sql="select * from O3888_admin where id="&id
set rs=conn.execute(sql)
if rs.bof and rs.eof then
rs.close
set rs=nothing
Call outcome("非法操作")
Response.End
else
username=rs("username")
password=rs("password")
level=rs("level")
rs.close
set rs=nothing
end if
if action="doit" then
if Trim(request("pw1"))="" then
Call outcome("请输入原密码")
Response.End
end if
if Trim(request("pw2"))="" then
Call outcome("请输入新密码")
Response.End
end if
if Trim(request("pw3"))="" then
Call outcome("请确认新密码")
Response.End
end if
if Trim(request("pw2"))<>Trim(request("pw3")) then
Call outcome("两次输入的密码不一样")
Response.End
end if
if Cstr(md5(Trim(request("pw1"))))<>Cstr(password) then
Call outcome("原密码输入错误")
Response.End
end if
pw2=md5(ReplaceBadChar(Trim(request("pw2"))))
set r=server.createobject("adodb.recordset")
r.open "select * from O3888_admin where id="&id,conn,1,3
if not r.eof then
r("password")=pw2
r.update
r.close
set r=nothing
Call outcome("管理员信息已成功更改")
Response.End
else
r.close
set r=nothing
Call outcome("非法操作")
Response.End
end if
end if
%>
<html>
<head>
<title>修改管理员信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK REL="stylesheet" HREF="css.css" TYPE="text/css">
</head>
<body>
<table width="96%" border="0" cellspacing="1" cellpadding="8" align="center" class="b">
<tr>
<td align="center">更改当前管理员信息</td>
</tr></table>
<table width="96%" border="0" cellspacing="1" cellpadding="8" align="center" class="a">
<tr>
<form action="admin_admin_edit.asp?id=<%=id%>" method="post">
<td width="100"><br>管理员帐号:</td>
<td><input class="c" type="username" name="0" value=<%=username%> disabled></td>
</tr>
<tr>
<td>请输入原密码:</td>
<td><input class="c" type="password" name="pw1"> <font color="red">*</font></td>
</tr>
<tr>
<td>请输入新密码:</td>
<td><input class="c" type="password" name="pw2"> <font color="red">*</font></td>
</tr>
<tr>
<td>请确认新密码:</td>
<td><input class="c" type="password" name="pw3"> <font color="red">*</font></td>
</tr>
<tr>
<td></td>
<td><input type="submit" class="d"></td>
</tr>
<tr>
<td colspan="2"><font color="red">说明:普通管理员只可以修改密码,关于其他方面修改请联系高级管理员。</font></td>
<tr>
<td align="center" colspan="2">[<A href='http://www.03888.com/' target=_blank>03888网址大全</A>]</td>
</tr>
</table>
<input type="hidden" value="doit" name="action">
</form>
</body>
</html>
<%
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -