📄 admin_bbsftpuser.asp
字号:
set rs=bbsconn.execute("select * from "&FtpUserTable&" where id="&iid)
if rs.eof then
bbsftp_error("没有找到该用户。")
set rs = nothing
exit sub
end if
%>
<table cellpadding="2" cellspacing="1" border="0" width="95%" class="tableBorder" align=center>
<FORM METHOD=POST ACTION="?action=update">
<tr><th colspan=6 height=23 align=left>用户基本资料修改--<%=rs("username")%></th></tr>
<input name="userid" type=hidden value="<%=iid%>">
<tr>
<td width=20% class=forumrow>用户名</td>
<td width=80% class=forumrow colspan=5><%=Server.HtmlEncode(rs("username"))%></td>
</tr>
<tr>
<td width=20% class=forumrow>密码</td>
<td width=80% class=forumrow colspan=5><input size=45 name="password" type=text value="<%=rs("UserPassword")%>">[*]</td>
</tr>
<tr>
<td width=20% class=forumrow>对应角色名</td>
<td width=80% class=forumrow colspan=5><input size=45 name="linkname" type=text value="<%=rs("linkname")%>"></td>
</tr>
<tr>
<td width=20% class=forumrow>FTP服务器</td>
<td width=80% class=forumrow colspan=5><input size=45 name="ftp" type=text value="<%=rs("ftp")%>"></td>
</tr>
<tr>
<td width=20% class=forumrow>可用流量</td>
<td width=80% class=forumrow colspan=5><input size=45 name="maxdownsize" type=text value="<%=rs("maxdownsize")%>"> 字节 <font color=red>[-9876543210 表示不限流量]</font></td>
</tr>
<tr>
<td width=20% class=forumrow>下载速度</td>
<td width=80% class=forumrow colspan=5> <%=getlinkspeed(rs("linkname"))%> + <input size=45 name="maxdownspeed" type=text value="<%=rs("MaxDownSpeed")%>"> 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="<%=rs("QuotaMax")%>"> 字节[该值小于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="<%=rs("QuotaUsed")%>"> 字节</td>
</tr>
<%
On Error Resume Next
Dim bcheck
If rs("DisableUser") Then
bcheck = ""
Else
bcheck = "checked"
End If
Response.Write "<tr>"
Response.Write "<td width=20% class=forumrow>账号是否有效</td>"
Response.Write "<td width=80% class=forumrow colspan=5><input type=checkbox name=enable " & bcheck & " value=yes></td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td width=20% class=forumrow>过期时间</td>"
Response.Write "<td width=80% class=forumrow colspan=5><input size=45 name=expiretime type=text value=" & rs("ExpireTime") & "> </td>"
Response.Write "</tr>"
If Err Then Err.Clear
%>
<tr>
<td width=20% class=forumrow>允许登录IP地址</td>
<td width=80% class=forumrow colspan=5><input size=45 name="allowip" type=text value="<%=rs("allowip")%>"> 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>
<%
set rs=nothing
end sub
sub updateuser()
dim id
id = request("userid")
set rs = server.createobject("adodb.recordset")
rs.open "select * from ftpuserdown where id="&id,bbsconn,1,3
if rs.eof then
response.write "user not found!"
set rs = nothing
exit sub
end if
rs("allowip")=request("allowip")
rs("quotaused")=request("quotaused")
rs("quotamax")=request("quotamax")
rs("maxdownspeed")=request("maxdownspeed")
rs("maxdownsize")=request("maxdownsize")
rs("ftp")=request("ftp")
rs("linkname")=request("linkname")
rs("linkname") = Request("linkname")
On Error Resume Next
If Request("Enable") = "" Then
rs("DisableUser") = True
Else
rs("DisableUser") = False
End If
if request("ExpireTime") then rs("ExpireTime") = request("ExpireTime")
if rs("UserPassword") <> request("password") and request("password")<> "" then
rs("UserPassword") = MD5(request("password"),16)
end if
If Err Then Err.Clear
rs.update
bbsftp_suc("<p align='enter'>OK,更新成功!</p><br>")
end sub
sub touser()
dim i,n
n = request("userid")
if n="" then
founderr = true
errmsg = errmsg +"<br>请先选择用户."
exit sub
end if
i = clng(request("useraction"))
if 1 = i then
call deleteuser
end if
end sub
sub showuser()
dim iid
iid = request("userid")
set rs=bbsconn.execute("select * from "&FtpUserTable&" where id="&iid)
if rs.eof then
bbsftp_error("没有找到该用户。")
set rs = nothing
exit sub
end if
dim dup,ddown,sup,sdown,lasttime,lastip,fup,fdown,logintimes,ftpip
dim mrs,uname,ttime
uname = rs("username")
ftpip = rs("ftp")
dup = 0
ddown = 0
fup = 0
fdown = 0
logintimes = 0
set mrs = logconn.execute("select * from FtpLog_UserStatistic where ftp='"&ftpip&"' and username='"&uname&"'")
if not mrs.eof then
dup = mrs("kbup") * 1024
ddown = mrs("kbdown") * 1024
fup = mrs("fup")
fdown = mrs("fdown")
logintimes = mrs("logintimes")
end if
set mrs=nothing
sup = FileSizeStr(dup)
sdown = FileSizeStr(ddown)
lastip = "0.0.0.0"
lasttime = 0
set mrs=logconn.execute("select * from FtpLog_UserLastLogin where ftp='"&ftpip&"' and username='"&uname&"' order by lasttime desc")
if not mrs.eof then
lasttime = mrs("lasttime")
lastip = mrs("ip")
end if
%>
<table cellpadding="2" cellspacing="1" border="0" width="95%" class="tableBorder" align=center>
<tr><th colspan=6 height=23 align=center>FTP用户基本资料--<%=rs("username")%></th></tr>
<tr>
<td width=20% class=forumrow>用户名</td>
<td width=80% class=forumrow colspan=5><%=Server.HtmlEncode(rs("username"))%></td>
</tr>
<tr>
<td width=20% class=forumrow>对应角色名</td>
<td width=80% class=forumrow colspan=5><%=rs("linkname")%></td>
</tr>
<tr>
<td width=20% class=forumrow>FTP服务器</td>
<td width=80% class=forumrow colspan=5><%=rs("ftp")%></td>
</tr>
<tr>
<td width=20% class=forumrow>可用流量</td>
<td width=80% class=forumrow colspan=5><%=rs("maxdownsize")%> 字节[<font color=blue><%=filesizestr(rs("maxdownsize"))%></font>]</td>
</tr>
<tr>
<td width=20% class=forumrow>下载速度</td>
<td width=80% class=forumrow colspan=5> <%=getlinkspeed(rs("linkname"))%> + <%=rs("MaxDownSpeed")%> KB/S</td>
</tr>
<tr>
<td width=20% class=forumrow>磁盘配额</td>
<td width=80% class=forumrow colspan=5><%=rs("QuotaMax")%> 字节[<font color=blue><%=filesizestr(rs("QuotaMax"))%></font>][该值小于1024表示不限空间]</td>
</tr>
<tr>
<td width=20% class=forumrow>使用空间</td>
<td width=80% class=forumrow colspan=5><%=rs("QuotaUsed")%> 字节[<font color=blue><%=filesizestr(rs("QuotaUsed"))%></font>]</td>
</tr>
<tr>
<td width=20% class=forumrow>允许登录IP地址</td>
<td width=80% class=forumrow colspan=5><%=rs("allowip")%> </td>
</tr>
<tr><th colspan=6 height=23 align=center>用户FTP统计信息</th></tr>
<tr>
<td width=20% class=forumrow>共上传:</td>
<td width=80% class=forumrow colspan=5><%=dup%> Bytes <font color=red>(大约 <%=sup%>)</font> 文件 <%=fup%> 个</td>
</tr>
<tr>
<td width=20% class=forumrow>共下载:</td>
<td width=80% class=forumrow colspan=5><%=ddown%> Bytes <font color=red>(大约 <%=sdown%>)</font> 文件 <%=fdown%> 个</td>
</tr>
<tr>
<td width=20% class=forumrow>登录次数:</td>
<td width=80% class=forumrow colspan=5><%=logintimes%></td>
</tr>
<tr>
<td width=20% class=forumrow>最后登录时间:</td>
<td width=80% class=forumrow colspan=5><%=LastTime%></td>
</tr>
<tr>
<td width=20% class=forumrow>最后登录IP:</td>
<td width=80% class=forumrow colspan=5><%=Lastip%></td>
</tr>
</table>
<p><center>
<a href="<%=Request.ServerVariables("HTTP_REFERER")%>" ><<返回上一页</a></center></p>
<%
end sub
Sub DeleteUser()
dim mrs
dim i
i = clng(request("dellog"))
if 1 = i then
set mrs = bbsconn.execute("select * from "&FtpUserTable&" where ID in ("&request("userid")&")")
if mrs.eof then
bbsftp_error("User not found!")
exit sub
end if
while not mrs.eof
logconn.execute "delete from FtpLog_DownLoadFiles" & " where Username='" &mrs("UserName")& "' and FTP='"&mrs("FTP")& "'"
logconn.execute "delete from FtpLog_IPLastLogin" & " where Username='" &mrs("UserName")& "' and FTP='"&mrs("FTP")& "'"
logconn.execute "delete from FtpLog_Login" & " where Username='" &mrs("UserName")& "' and FTP='"&mrs("FTP")& "'"
logconn.execute "delete from FtpLog_UpLoadAbort" & " where Username='" &mrs("UserName")& "' and FTP='"&mrs("FTP")& "'"
logconn.execute "delete from FtpLog_UpLoadFiles" & " where Username='" &mrs("UserName")& "' and FTP='"&mrs("FTP")& "'"
logconn.execute "delete from FtpLog_UpLoadTemp" & " where Username='" &mrs("UserName")& "' and FTP='"&mrs("FTP")& "'"
logconn.execute "delete from FtpLog_UserLastLogin" & " where Username='" &mrs("UserName")& "' and FTP='"&mrs("FTP")& "'"
logconn.execute "delete from FtpLog_UserStatistic" & " where Username='" &mrs("UserName")& "' and FTP='"&mrs("FTP")& "'"
logconn.execute "delete from FtpLog_DiskStatistic" & " where Username='" &mrs("UserName")& "' and FTP='"&mrs("FTP")& "'"
mrs.movenext
wend
mrs.close
set mrs=nothing
end if
bbsconn.execute "delete from ftpuserdown where ID in ("&request("userid")&")"
bbsftp_suc("删除用户成功!")
end Sub
sub newupdate()
on error resume next
dim ftpinfo,iid
set rs = logconn.execute("select id,ftp from ftpconfig where id="&request("ftpid"))
if rs.eof then
bbsftp_error("请选择Ftp服务器!")
exit sub
end if
ftpinfo = rs("ftp")
iid = rs("id")
set rs =nothing
set rs = server.createobject("adodb.recordset")
rs.open "select * from FtpUserDown where UserName='"&request("UserName")&"' and FTP='"&ftpinfo&"'",bbsconn,1,3
if rs.eof then
rs.addnew
else
bbsftp_error "该用在选定的Ftp服务器已存在!"
rs.close
set rs=nothing
exit sub
end if
rs("username") = request("username")
rs("userpassword") = MD5(request("password"),16)
rs("ftp") = ftpinfo
rs("maxdownsize") = request("maxdownsize")
rs("maxdownspeed") = request("maxdownspeed")
rs("quotaused") = request("quotaused")
rs("quotamax") = request("quotamax")
rs("allowip") = request("allowip")
rs("linkname") = GetDefaultLinkName(ftpinfo)
rs.update
rs.close
set rs=nothing
if err then
bbsftp_error(err.description)
err.clear
else
bbsftp_suc("新用户注册成功!")
end if
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -