📄 usermanage.asp
字号:
<!--#include file=conn.asp --><!--#include file="char.inc"-->
<!--#include file=../include/config.asp -->
<!--#include file="chkuser.asp" -->
<%
IF not(request.cookies("KEY")="super" or request.cookies("key")="typemaster" or request.cookies("key")="bigmaster") THEN
response.redirect "index_face.asp"
response.end
else
usernamecookie=CheckStr(request.cookies("UserName"))
passwdcookie=replace(trim(Request.cookies("passwd")),"'","''")
KEYcookie=replace(trim(request.cookies("KEY")),"'","''")
if usernamecookie="" or passwdcookie="" then
response.redirect "login.asp"
response.end
else
'判断用户的合法性
set rs=server.createobject("adodb.recordset")
sql="select * from admin where username='"&usernamecookie&"'"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.redirect "login.asp"
response.end
end if
IF passwdcookie<>rs("passwd") THEN
response.redirect "login.asp"
response.end
END IF
'下面判断用户级别实际在有用户级别是都应该判断
if KEYcookie<>rs("OSKEY") then
response.redirect "index_face.asp"
response.end
end if
rs.close
set rs=nothing
END IF
END IF
dim oskey
dim rs,tsql
dim rst
oskey=request("oskey")
set rst=server.CreateObject("ADODB.RecordSet")
if request.cookies("key")="super" then
if oskey="" then
rst.Source="select * from admin order by ID"
else
rst.Source="select * from admin where oskey='"&oskey&"' order by ID"
end if
else
if oskey="" then
rst.Source="select * from admin where adder='"&request.cookies("username")&"' order by ID"
else
rst.Source="select * from admin where adder='"&request.cookies("username")&"' and oskey='"&oskey&"' order by ID"
end if
end if
rst.Open rst.Source,conn,3,1
PageShowSize = 10 '每页显示多少个页
MyPageSize = 10 '每页显示多少用户
If Not IsNumeric(Request("page")) Or IsEmpty(Request("page")) Or Request("page") <=0 Then
MyPage=1
Else
MyPage=Int(Abs(Request("page")))
End if
If Not rst.eof then
rst.PageSize = MyPageSize
MaxPages = rst.PageCount
rst.absolutepage = MyPage
total = rst.RecordCount
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href=site.css rel=stylesheet>
<title><%=copyright%><%=version%> <%=ver%> - 用户管理</title>
</head>
<body topmargin="0"><!--#include file=top.asp-->
<p align=center>用户列表(<font color=red>红色</font>表示当前用户),点击用户名可查看更多信息 <a href="useradd1.asp">添加用户</a> <a href="usermanage.asp">全部用户</a><br>
<table align=center border="1" width="750" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="<%=border%>">
<tr align="center" bgcolor="<%=m_top%>" height=20>
<td width="4%">ID号</td>
<td width="7%">用户名</td>
<td width="10%">权限</td>
<td width="12%">最后登录地址</td>
<td width="16%">最后登录时间</td>
<td width="9%">登录次数</td>
<td width="6%">发文数</td>
<td width="4%">修改</td>
<td width="4%">删除</td>
<td width="15%">会员等级</td>
<td width="15%">会员状态</td>
</tr> <%
for i=1 to rst.PageSize
if not rst.EOF then%>
<%if rst("purview")<>"99999" or request.cookies("purview")="99999" then%>
<tr align="center" height=20><%if (request.cookies("key")="bigmaster" and rst("oskey")="smallmaster") or (request.cookies("key")="typemaster" and (rst("oskey")="bigmaster" or rst("oskey")="smallmaster")) or request.cookies("key")="super" then%>
<td width="4%" align="center"><%=rst("id")%> </td>
<td width="7%" align="center" bgcolor="#FFFFFF"><a href="list.asp?id=<%=rst("id")%>" title="<%=rst("passwd")%>"><%if rst("username")=request.cookies("username") then%><font color=red><%end if%><%=rst("Username")%><%if rst("username")=request.cookies("username") then%></font><%end if%></a> </td>
<td width="10%" align="center" bgcolor="#FFFFFF"><%if rst("oskey")="super" and rst("purview")="99999" then%><font color="red">超级管理员</font><%end if%><%if rst("oskey")="super" and rst("purview")<>"99999" then%>系统管理员<%end if%><%if rst("oskey")="check" then%><a href="usermanage.asp?oskey=<%=rst("oskey")%>">文章审核员</a><%end if%><%if rst("oskey")="selfreg" then%><a href="usermanage.asp?oskey=<%=rst("oskey")%>">注册用户</a><%end if%><%if rst("oskey")="smallmaster" then%><a href="usermanage.asp?oskey=<%=rst("oskey")%>">小类管理员</a><%end if%><%if rst("oskey")="bigmaster" then%><a href="usermanage.asp?oskey=<%=rst("oskey")%>">大类管理员</a><%end if%><%if rst("oskey")="typemaster" then%><a href="usermanage.asp?oskey=<%=rst("oskey")%>">总栏管理员</a><%end if%></td>
<td width="12%" align="center"><%=rst("IP")%> </td>
<td width="15%"><%=rst("lastlogin")%> </td>
<td width="6%" align="center"><%=rst("logins")%> </td>
<td width="9%" align="center"><%=rst("number")%> </td>
<td width="4%" align="center" bgcolor="#FFFFFF"><a href="useredit.asp?id=<%=rst("id")%>" onMouseOver="window.status='修改用户“<%=rst("Username")%>”的属性';return true;" onMouseOut="window.status='';return true;" title='修改用户“<%=rst("Username")%>”的属性'>修改</a></td>
<td width="4%" align="center" bgcolor="#FFFFFF"><%if trim(request.cookies("username"))=trim(rst("username")) then%>----<%else%><a href="userdel.asp?id=<%=rst("id")%>&name=del" onMouseOver="window.status='删除用户“<%=rst("Username")%>”';return true;" onMouseOut="window.status='';return true;" title='删除用户“<%=rst("Username")%>”'>删除</a><%end if%></td>
<%end if%>
<td width="15%"><%if rst("oskey")="selfreg" then%><form name="form1" method="post" action="userlevel.asp?ID=<%=rst("ID")%>">
<select name="reglevel" style="font-family: 宋体; font-size: 9pt" size=1>
<option <%if rst("reglevel")=1 then%>selected<%end if%> value="1">普通</option><option <%if rst("reglevel")=2 then%>selected<%end if%> value="2">高级</option><option <%if rst("reglevel")=3 then%>selected<%end if%> value="3">特级</option>
</select><input type="submit" name="Submit2" value="保存" style="font-family: 宋体; font-size: 9pt"><%end if%>
</td></form>
<td width="15%"><%if rst("oskey")="selfreg" then%><form name="form1" method="post" action="userjingyong.asp?ID=<%=rst("ID")%>">
<select name="jingyong" style="font-family: 宋体; font-size: 9pt" size=1>
<option <%if rst("jingyong")=1 then%>selected<%end if%> value="1">禁用</option><option <%if rst("jingyong")=0 then%>selected<%end if%> value="0">启用</option>
</select><input type="submit" name="Submit2" value="保存" style="font-family: 宋体; font-size: 9pt"><%end if%>
</td></form>
</tr>
<%end if%>
<%
rst.MoveNext
end if
next
rst.close
%>
<tr height=20>
<td colspan=11 bgcolor="<%=m_top%>"><p align=center height=25>共 <%=total%> 名,当前第 <%=Mypage%>/<%=Maxpages%>
页,每页 <%=MyPageSize%> 名
<%
if oskey="" then
url="usermanage.asp?"
else
url="usermanage.asp?oskey="&oskey&"&"
end if
PageNextSize=int((MyPage-1)/PageShowSize)+1
Pagetpage=int((total-1)/rst.PageSize)+1
if PageNextSize >1 then
PagePrev=PageShowSize*(PageNextSize-1)
Response.write "<a class=black href='" & Url & "page=" & PagePrev & "' title='上" & PageShowSize & "页'>上一翻页</a> "
Response.write "<a class=black href='" & Url & "page=1' title='第1页'>页首</a> "
end if
if MyPage-1 > 0 then
Prev_Page = MyPage - 1
Response.write "<a class=black href='" & Url & "page=" & Prev_Page & "' title='第" & Prev_Page & "页'>上一页</a> "
end if
if Maxpages>=PageNextSize*PageShowSize then
PageSizeShow = PageShowSize
Else
PageSizeShow = Maxpages-PageShowSize*(PageNextSize-1)
End if
If PageSizeShow < 1 Then PageSizeShow = 1
for PageCounterSize=1 to PageSizeShow
PageLink = (PageCounterSize+PageNextSize*PageShowSize)-PageShowSize
if PageLink <> MyPage Then
Response.write "<a class=black href='" & Url & "page=" & PageLink & "'>[" & PageLink & "]</a> "
else
Response.Write "<B>["& PageLink &"]</B> "
end if
If PageLink = MaxPages Then Exit for
Next
if Mypage+1 <=Pagetpage then
Next_Page = MyPage + 1
Response.write "<a class=black href='" & Url & "page=" & Next_Page & "' title='第" & Next_Page & "页'>下一页</A>"
end if
if MaxPages > PageShowSize*PageNextSize then
PageNext = PageShowSize * PageNextSize + 1
Response.write " <A class=black href='" & Url & "page=" & Pagetpage & "' title='第"& Pagetpage &"页'>页尾</A>"
Response.write " <a class=black href='" & Url & "page=" & PageNext & "' title='下" & PageShowSize & "页'>下一翻页</a>"
End if
%>
</td>
</tr></table><p align=center> <font color="#FF0000"><li>
<p align="center">总栏管理员设置:在添加总栏管理员后请在“总栏管理”再设置一下。</li><li>
<p align="center">大类管理员设置:在添加大类管理员后请在“大类管理”再设置一下。</li><li>
<p align="center">小类管理员设置:在添加小类管理员后请在“小类设置”设置。</li><li>
<p align="center">系统管理员具有所有权限。</li><li>
<p align="center">文章审核员可管理所有大类文章,不必在大类中添加。</li><li>
<p align="center">注册用户可在所有类别中发表文章。</li></font>
</body>
</html><%else%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href=site.css rel=stylesheet>
<title><%=copyright%><%=version%> <%=ver%> - 用户管理</title>
</head>
<body topmargin="0"><!--#include file=top.asp-->
</p>
<p> </p>
<p> </p>
<p> </p>
<div align="center">
<center>
<table border="1" width="450" cellspacing="0" bgcolor="#000000" bordercolor="<%=border%>" cellpadding="0" style="border-collapse: collapse">
<tr>
<td width="100%" align="center" bgcolor="#FFFFFF">
<p> </p>
<p>当前无用户!</p>
<p> <a href="useradd1.asp">
添加用户</a></p>
<p> </p>
</td>
</tr>
</table>
</center>
</div>
</body>
</html><%end if%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -