📄 aid_mang.asp
字号:
<!-- #include file="common.asp"-->
<!-- #include file="md5.asp"-->
<!-- #include file="isadm.asp" -->
<%
Dim zsb_auth, hasAuth
hasAuth = False
zsb_auth = Split( Trim( session("zsb_auth") ), ",", -1, 1 )
For Each auth In zsb_auth
If ( auth = "account" ) Then
hasAuth = True
Exit For
End If
Next
If hasAuth = false and session("zsb_admtp")="normaladm" Then
Response.Write("<script language=javascript>alert('对不起,你没有权限,请联系超级管理员!');history.back(-1);</script>")
End If
%>
<%
if Trim(Request("op"))="ModS" then
set rs=Server.CreateObject("ADODB.Recordset")
sqlstr="select * from Admin Where ID=" & Trim(Request("ID"))
rs.open sqlstr,conn,1,3
if not rs.eof then
rs("AdmID")=Trim(Request.Form("AID"))
If rs("AdmPS") <> Trim(Request.Form("APS")) Then
rs("AdmPS")=md5(Trim(Request.Form("APS")))
End If
if Request.Form("ATP")=1 then
rs("AdmTP")=True
rs("Authorization")="config,news,account,modguest,repguest,delguest,settop"
else
rs("AdmTP")=False
end if
rs.Update
end if
rs.close
set rs=nothing
elseif Trim(Request("op"))="Add" then
If Trim(Request.Form("AID"))="" or Trim(Request.Form("APS"))="" Then
Response.Write("<script language=javascript>alert('请输入帐号和密码!');history.back(-1);</script>")
End If
set rs=Server.CreateObject("ADODB.Recordset")
sqlstr="select * from Admin Where AdmID='" & Trim(Request.Form("AID")) & "'"
rs.open sqlstr,conn,1,3
if not rs.eof then
Response.Write("<script language=javascript>alert('该管理员已经存在!');history.back(-1);</script>")
else
rs.AddNew
rs("AdmID")=Trim(Request.Form("AID"))
rs("AdmPS")=md5(Trim(Request.Form("APS")))
if Request.Form("ATP")=1 then
rs("AdmTP")=True
rs("Authorization")="config,news,account,modguest,repguest,delguest,settop"
else
rs("AdmTP")=False
rs("Authorization")=",,,,,,"
end if
rs.Update
end if
rs.close
set rs=nothing
elseif Trim(Request("op"))="Del" then
SQLDel="Delete from Admin Where ID=" & Trim(Request("ID"))
conn.Execute(SQLDel)
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<%=Char_Set%>">
<title>管理员账号管理</title>
<link href="<%=GBCss%>/common.css" rel="stylesheet" type="text/css">
</head>
<body>
<% if Trim(Request("op"))="Mod" then %>
<%
set rs=Server.CreateObject("ADODB.Recordset")
sqlstr="select * from Admin Where ID=" & Trim(Request("ID"))
rs.open sqlstr,conn,1,3
if not rs.eof then
%>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" style="background-image:url(<% =GBSkin %>/guest_bg.gif) ">
<tr align="center">
<td height="10" colspan="2"> </td>
</tr>
<tr align="center">
<td height="30" colspan="2" style="background-image:url(<% =GBSkin %>/guest_top.gif) ">修改管理帐号</td>
</tr>
<form name="form1" method="post" action="Aid_mang.asp?op=ModS&pn=<%=Request("pn")%>&ID=<% =Trim(rs("ID")) %>">
<tr>
<td width="200" height="30" align="right">管理员帐号:</td>
<td height="30">
<input name="AID" type="text" class="input_common" style="width: 140px; height:18px;" id="AID" value="<% =Trim(rs("AdmID")) %>">
</td>
</tr>
<tr>
<td height="30" align="right">管理员密码:</td>
<td height="30"><input name="APS" type="password" class="input_common" style="width: 140px; height:18px;" id="APS" value="<% =Trim(rs("AdmPS")) %>"></td>
</tr>
<tr>
<td height="30" align="right">管理员类型:</td>
<td height="30"><select name="ATP" id="ATP">
<% if rs("AdmTP")=True then %><option value="1" selected>超级管理员</option>
<option value="0">普通管理员</option>
<% else %>
<option value="0" selected>普通管理员</option>
<option value="1">超级管理员</option><% end if %>
</select></td>
</tr>
<tr align="center">
<td height="30" colspan="2">
<input type="button" onClick="javascript:location.href='manage.asp?pn=<%=Trim(Request("pn"))%>';" value="返 回" class="button_common" style="width: 80px; height:18px;">
<input type="reset" class="button_common" style="width: 80px; height:18px;" name="Submit" value="重置">
<input type="submit" class="button_common" style="width: 80px; height:18px;" name="Submit" value="提交"></td>
</tr>
<tr align="center" bgcolor="#CCCCCC">
<td height="20" colspan="2"> </td>
</tr>
</form>
</table>
<%
end if
rs.close
set rs=nothing
%>
<% end if %>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" style="background-image:url(<% =GBSkin %>/guest_bg.gif) ">
<tr>
<td height="30" colspan="5"></td>
</tr>
<tr align="center">
<td height="30" colspan="5" style="background-image:url(<% =GBSkin %>/guest_top.gif) ">管理员列表</td>
</tr>
<tr align="center">
<td width="50" height="30">编号</td>
<td width="100">管理用户名</td>
<td width="100" height="30">管理密码</td>
<td width="100" height="30">管理类型</td>
<td width="250">操作</td>
</tr>
<%
set rs=Server.CreateObject("ADODB.Recordset")
sqlstr="select * from Admin"
rs.open sqlstr,conn,1,3
if not rs.eof then
while not rs.eof
%>
<tr align="center">
<td height="30"><% =rs("ID") %></td>
<td height="30"><% =rs("AdmID") %></td>
<td height="30"><% '=rs("AdmPS") %>**********</td>
<td height="30"><% if rs("AdmTP")=True then %>超级管理员<% else %>普通管理员<% end if %></td>
<td height="30"><a href="Aid_mang.asp?op=Mod&pn=<%=Request("pn")%>&ID=<% =rs("ID") %>">修改</a> <a href="Aid_mang.asp?op=Del&pn=<%=Request("pn")%>&ID=<% =rs("ID") %>">删除</a> <a href="authsetting.asp?pn=<%=Request("pn")%>&id=<% =rs("ID") %>">设置管理权限</a></td>
</tr>
<%
rs.movenext
wend
end if
rs.close
set rs=nothing
%>
<tr align="center">
<td height="10" colspan="5"> </td>
</tr>
</table>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" style="background-image:url(<% =GBSkin %>/guest_bg.gif) ">
<tr align="center" bgcolor="#CCCCCC">
<td height="10" colspan="2"> </td>
</tr>
<tr align="center">
<td height="27" colspan="2" style="background-image:url(<% =GBSkin %>/guest_top.gif) ">增加管理帐号</td>
</tr>
<form name="form1" method="post" action="Aid_mang.asp?pn=<%=Request("pn")%>&op=Add">
<tr>
<td width="200" height="30" align="right">管理员帐号:</td>
<td height="30">
<input name="AID" class="input_common" style="width: 140px; height:18px;" type="text" id="AID">
</td>
</tr>
<tr>
<td height="30" align="right">管理员密码:</td>
<td height="30"><input name="APS" class="input_common" style="width: 140px; height:18px;" type="password" id="APS"></td>
</tr>
<tr>
<td height="30" align="right">管理员类型:</td>
<td height="30"><select name="ATP" id="ATP">
<option value="0" selected>普通管理员</option>
<option value="1">超级管理员</option>
</select></td>
</tr>
<tr align="center">
<td height="30" colspan="2">
<input type="button" onClick="javascript:location.href='manage.asp?pn=<%=Trim(Request("pn"))%>';" value="返 回" class="button_common" style="width: 80px; height:18px;">
<input type="reset" class="button_common" style="width: 80px; height:18px;" name="Submit" value="重置">
<input type="submit" class="button_common" style="width: 80px; height:18px;" name="Submit" value="提交"></td>
</tr></form>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -