📄 admin_bbsftpuser.asp
字号:
<!--#include file="inc/ftp.asp"-->
<!--#include file="inc/md5.asp"-->
<script language="JavaScript">
<!--
function CheckAll(form) {
for (var i=0;i<form.elements.length;i++) {
var e = form.elements[i];
if (e.name == 'userid') e.checked = form.chkall.checked;
}
}
//-->
</script>
<%Head()%>
<H1 align=center>Ftp论坛用户管理</H1>
<%
if not CheckAdmin() then
response.end
else
if request("action")="edit" then
call edituser()
elseif request("action")="touser" then
call touser()
elseif request("action")="update" then
call updateuser()
elseif request("action")="newupdate" then
call newupdate()
elseif request("action")="show" then
call showuser()
elseif request("action") = "newuser" then
call newuser
else
call main()
end if
if founderr then bbsftp_Error(errmsg)
end if
BBSFTP_Footer()
%>
</body></html>
<%
sub main()
dim ftpinfo
dim usertype,iid,i
if "" = request("usertype") or not isnumeric(request("usertype")) then
usertype=0
else
usertype=request("usertype")
end if
%>
<table cellpadding="2" cellspacing="1" border="0" width="95%" class="tableBorder" align=center>
<form action="?action=userSearch" method=post>
<tr>
<td width=20% class=forumrow>按FTP服务器查看用户</td>
<td width=80% class=forumrow>
<select size=1 name="usertype" onchange="javascript:submit()">
<option value="0" <%if usertype=0 then%>selected<%end if%>>所有服务器用户</option>
<%set rs=logconn.execute("select id,ftp from ftpconfig")
ftpinfo=""
while not rs.eof
iid = rs("id")
if clng(usertype)=clng(iid) then
ftpinfo = rs("ftp")%>
<option value="<%=rs("id")%>" selected>服务器:<%=rs("ftp")%></option>
<%
else
%>
<option value="<%=rs("id")%>" >服务器:<%=rs("ftp")%></option>
<%
end if
rs.movenext
wend
set rs=nothing%>
</select>
</td>
</tr>
</form>
<form action="?action=userSearch" method=post>
<tr><td width=20% class=forumrow>按用户名搜索</td>
<input type=hidden name="usertype" value="-1">
<td width=80% class=forumrow><input type=text size=20 name="username" value="<%=request("username")%>"> <input type=checkbox name="usernamechk" value="yes" <%if request("usernamechk")="yes" then%> checked<%end if%>>用户名完整匹配
<input type=submit value="搜索"></td></tr>
</form>
<tr>
<td colspan=2 height=25 class="forumRowHighlight">
<b>当前浏览的服务器[<%=ftpinfo%>]所有用户列表如下,注意: <font color=blue>如果角色名显示为<font color=red>红色</font>,表示该角色尚未配置,请点击进行配置.</font></b>
</td>
</tr>
</table><BR>
<%
dim pagesize, page, filenum, pagenum, endpage,clr
pagesize=40
page=request.querystring("page")
if page="" or not isnumeric(page) then
page=1
else
page=int(page)
end if
%>
<table cellpadding="2" cellspacing="1" border="0" width="95%" class="tableBorder" align=center style="table-layout:fixed;word-break:break-all">
<FORM METHOD=POST ACTION="?action=touser">
<tr align=center>
<th width="30" height=25>选择</th>
<th width="80">用户名</th>
<th width=30>状态</th>
<th width="*">对应角色名</th>
<th width="80">FTP服务器</th>
<th width="60">可用流量</th>
<th width="60">下载速度</th>
<th width="60">磁盘配额</th>
<th width="60">使用空间</th>
<th width="70">允许登录IP地址</th>
<th width=100>过期时间</th>
<th width=70>操作</th>
</tr>
<%
if usertype=0 then
sql = "select * from " & FtpUserTable
elseif -1 = clng(usertype) and request("username")<> "" then
if request("usernamechk") = "yes" then
sql = "select * from " & FtpUserTable & " where UserName = '" & request("username") & "'"
else
sql = "select * from " & FtpUserTable & " where UserName like '%" & request("username") & "%'"
end if
else
sql = "select * from " & FtpUserTable & " where ftp='" & ftpinfo & "'"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,bbsconn,1,1
if not(rs.bof and rs.eof) then
filenum = GetRecordCount(rs)
pagenum=int(filenum/pagesize)
if filenum mod pagesize>0 then
pagenum=pagenum+1
end if
if page> pagenum then
page=1
end if
rs.movefirst
rs.move (page-1)*pagesize
i=0
while (not rs.eof) and i<pagesize
iid = CheckLinkName(rs("linkname"))
if iid<1 then
clr = "red"
else
clr = "blue"
end if
%>
<tr><td align=center height=24 class=forumrow><input type="checkbox" name=userid value="<%=rs("id")%>"></td>
<td align=center height=24 class=forumrow><a href=?action=edit&userid=<%=rs("id")%>><%=rs("username")%></a></td>
<%
If rs("DisableUser") Then
Response.Write " <td align=center class=forumrow><font color=red>X</font></td>"
Else
Response.Write " <td align=center class=forumrow><font color=blue>√</font></td>"
End If
%>
<td align=center class=forumrow><a href='admin_bbsftpusercfg.asp?action=edit&ID=<%=iid%>&username=<%=rs("linkname")%>'><font color=<%=clr%>><%=rs("linkname")%></font></a></td>
<td align=center class=forumrow><%=rs("FTP")%></td>
<td align=center class=forumrow><%=FileSizeStr(rs("MaxDownSize"))%></td>
<td align=center class=forumrow><%=getlinkspeed(rs("linkname"))%>+<%=rs("MaxDownSpeed")%>KBS</td>
<td align=center class=forumrow><%=FileSizeStr(rs("QuotaMax"))%></td>
<td align=center class=forumrow><%=FileSizeStr(rs("QuotaUsed"))%></td>
<td align=center class=forumrow><%=rs("AllowIP")%></td>
<td align=center class=forumrow><%=rs("ExpireTime")%></td>
<td align=center class=forumrow>[<a href='ftpfuwu.asp?action=query&id=<%=rs("userid")%>' target=_blank>FTP</a>][<a href=?action=show&userid=<%=rs("id")%>>高级</a>]</td>
</tr>
<%
i = i +1
rs.movenext
wend
else
response.write"<tr><td colspan=12 class=forumrow align=center>没有用户</td></tr>"
end if
response.write"<tr><td colspan=12 class=forumrow align=center><a href=?action=newuser>新建一个用户</a></td></tr>"
rs.close
set rs=nothing
%>
<tr><td class=forumrow align=center>
<input type=checkbox name=chkall onclick="CheckAll(this.form)">
</td>
<td class=forumrow align=left>全选</td>
<td colspan=10 align=center height=25 width=* class="forumRowHighlight">
<B>请选择您需要进行的操作</B>:
<select size=1 name="useraction">
<option value=1>删除</option>
</select>
</td>
</tr><tr>
<td colspan=12 align=center height=25 class="forumRowHighlight">
删除用户时从LogDB中删除该用户的所有记录
<input type=radio name=dellog value=1 checked>是
<input type=radio name=dellog value=2 >否
<input type=submit name=submit value="执行操作">
</td>
</tr>
</FORM>
</table>
<table border=0 cellpadding=0 cellspacing=3 width=100% align=center>
<tr><td valign=middle nowrap>
页次:<b><%=page%></b>/<b><%=pagenum%></b>页
每页<b><%=pagesize%></b> 总数<b><%=filenum%></b></td>
<td valign=middle nowrap><font color=red><div align=right><p>分页:
<%
if page > 4 then
response.write "<a href=""?page=1&usertype="&usertype&""">[1]</a> ..."
end if
if pagenum > page+3 then
endpage=page+3
else
endpage=pagenum
end if
for i=page-3 to endpage
if not i<1 then
if i = clng(page) then
response.write " <font color=blue>["&i&"]</font>"
else
response.write " <a href=""?page="&i&"&usertype="&usertype&""">["&i&"]</a>"
end if
end if
next
if page+3 < pagenum then
response.write "... <a href=""?page="&pagenum&"&usertype="&usertype&""">["&pagenum&"]</a>"
end if
%>
</p></div></font></td></tr></table>
<%
end sub
sub newuser()
%>
<table cellpadding="2" cellspacing="1" border="0" width="95%" class="tableBorder" align=center>
<FORM METHOD=POST ACTION="?action=newupdate">
<tr><th colspan=6 height=23 align=center>新用户注册</th></tr>
<tr>
<td width=20% class=forumrow>用户名</td>
<td width=80% class=forumrow colspan=5><input size=45 name="username" type=text value=""></td>
</tr>
<tr>
<td width=20% class=forumrow>密码</td>
<td width=80% class=forumrow colspan=5><input size=45 name="password" type=text value=""></td>
</tr>
<tr>
<td width=20% class=forumrow>FTP服务器</td>
<td width=80% class=forumrow colspan=5>
<select size=1 name="ftpid">
<option value="0" selected>请选择服务器</option>
<%set rs=logconn.execute("select id,ftp from ftpconfig")
while not rs.eof
%>
<option value="<%=rs("id")%>" >服务器:<%=rs("ftp")%></option>
<%
rs.movenext
wend
set rs=nothing%>
</select>
</td>
</tr>
<tr>
<td width=20% class=forumrow>可用流量</td>
<td width=80% class=forumrow colspan=5><input size=45 name="maxdownsize" type=text value="-9876543210"> 字节<font color=red>[-9876543210 表示不限流量]</font></td>
</tr>
<tr>
<td width=20% class=forumrow>下载速度</td>
<td width=80% class=forumrow colspan=5> X + <input size=45 name="maxdownspeed" type=text value="150"> KB/S</td>
</tr>
<tr>
<td width=20% class=forumrow>磁盘配额</td>
<td width=80% class=forumrow colspan=5><input size=45 name="quotamax" type=text value="0"> 字节[该值小于1024表示不限空间]</td>
</tr>
<tr>
<td width=20% class=forumrow>使用空间</td>
<td width=80% class=forumrow colspan=5><input size=45 name="quotaused" type=text value="0"> 字节</td>
</tr>
<tr>
<td width=20% class=forumrow>允许登录IP地址</td>
<td width=80% class=forumrow colspan=5><input size=45 name="allowip" type=text value="*"> IP地址(范围)规则和ServU一样,如1:202.*.11?.12-35 如2: 202.112.*.*;</td>
</tr>
<tr>
<td colspan=6 align=center height=25 class="forumRowHighlight">
<input type=reset value="重置"> <input type=submit value="注册">
</td></tr>
</form></table>
<%
end sub
sub edituser()
dim iid
iid = request("userid")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -