📄 ftpunion.asp
字号:
rs.close
set rs=nothing
dvbbs.execute "update dv_bbsftp set WebClick = WebClick + 1"
set mrs = logconn.execute("select * from ftpconfig where FTP='" & ftpip & "'")
if mrs.eof then
Dvbbs.AddErrCode( "<br><li><b><font color=red>Ftp尚未初始化配置,请联系管理员!</font></b>" )
exit sub
end if
ftpurl = mrs("FTPURL")
if ftpip = "default" then
set mrs=logconn.execute("select count(*) from FTPUserOnline")
else
set mrs=logconn.execute("select count(*) from FTPUserOnline where Ftp='"&ftpip&"'")
end if
sonline = mrs(0)
set mrs = nothing
if ftpip = "default" then
set mrs = logconn.execute("select * from FtpLog_Statistic")
else
set mrs = logconn.execute("select * from FtpLog_FtpStatistic where FTP='"&ftpip&"'")
end if
if not mrs.eof then
if isnull(mrs("UpTime")) then
upspeed = 0
else
upspeed = clng(mrs("UpTime"))
end if
if isnull(mrs("DownTime")) then
downspeed = 0
else
downspeed = clng(mrs("DownTime"))
end if
if upspeed>0 then
upspeed = mrs("UpLoadFileSize")*1024.0/upspeed
end if
if downspeed>0 then
downspeed = mrs("DownLoadFileSize")*1024.0/downspeed
end if
StartTime = mrs("StartTime")
upsize = mrs("UpLoadFileSize")
fup = mrs("UpLoadFileCount")
downsize = mrs("DownLoadFileSize")
fdown = mrs("DownLoadFileCount")
connecttimes = mrs("ConnectionTimes")
logintimes = mrs("LoginTimes")
else
downspeed = 0
upspeed = 0
StartTime = now()
upsize = 0
fup = 0
downsize = 0
fdown = 0
connecttimes = 0
logintimes = 0
end if
set mrs = nothing
%>
<table cellpadding=0 cellspacing=1 width=100% align=center>
<tr><td width=100%>
<table cellpadding=0 cellspacing=1 align=center class=tableborder1>
<tr>
<th height=25 colspan=2 align=center><b>状态:当前在线用户数 <%=sonline%></b></th>
</tr>
<tr>
<td class=tablebody2 height=20 width=200><font color=#333333><b>FTP名称:</b></font></td>
<td class=tablebody1 height=20 width=*><%=ftpname%></td>
</tr>
<tr >
<td height=20 class=tablebody2><font color=#333333><b>地址:</b></font></td>
<td class=tablebody1><%=ftpurl%></td>
</tr>
<tr>
<th height=25 colspan=2 align=center><b>自 <%=StartTime%> 以来</b></th>
</tr>
<tr>
<td height=20 class=tablebody2 width=200><font color=#333333><b>共上传:</b></font></td>
<td class=tablebody1 width=*><%=upsize*1024%> Bytes <font color=red>(大约 <%=filesizestr(upsize*1024)%>)</font> 文件 <%=fup%> 个 [平均速度<%=filesizestr(upspeed)%>/S]</td>
</tr>
<tr>
<td height=20 class=tablebody2 width=200><font color=#333333><b>共下载:</b></font></td>
<td class=tablebody1 width=*><%=downsize*1024%> Bytes <font color=red>(大约 <%=filesizestr(downsize*1024)%>)</font> 文件 <%=fdown%> 个 [平均速度<%=filesizestr(downspeed)%>/S]</td>
</tr>
<tr>
<td height=20 class=tablebody2 width=200><font color=#333333><b>处理连接:</b></font></td>
<td class=tablebody1 width=*><%=connecttimes%> <font color=red>(其中用户登录 <font color=blue><%=logintimes%></font> 次)</font></td>
</tr>
</table>
<tr>
<td class=tablebody1 colspan=2 height=20></td>
</tr>
</td></tr>
<tr><td>
<%
set rs = logconn.execute("select * from FtpUserDown where UserID=" & dvbbs.userid & " and FTP='" & ftpip & "'")
if rs.eof and rs.bof then
if breg then
call RegisterFtp(ftpip,id)
else
response.write "<table cellpadding=0 cellspacing=1 align=center class=tableborder1>"
response.write "<tr><th height=25 colspan=2 align='center'>该FTP暂停新用户注册.</th></tr></table>"
end if
else
if rs("DisableUser") then
ustatus = "[<font color=red>账号已被禁用</font>]&nbps;&nbps;"
else
if isnull(rs("ExpireTime")) then
ustatus = "[<font color=blue>正常</font>]"
else
ustatus = "账号将于 <font color=red>" & rs("ExpireTime") & "</font> 过期!"
end if
end if
call ShowFtp(ftpip,id,rs("AllowIP"),rs("MaxDownSize"),I_Gold)
end if
rs.close
set rs=nothing
end sub
sub RegisterFtp(ftpip,ftpid)
dim uname
uname = Prefix & dvbbs.membername
%>
<table cellpadding=0 cellspacing=1 align=center class=tableborder1>
<form action="ftpunion.asp" method=post name="FORM">
<input type=hidden name="action" value="active">
<input type=hidden name="ftpid" value="<%=ftpid%>">
<tr>
<th height=25 colspan=2 align='center'>你还没有在该FTP上面激活用户,请先激活!.</th>
</tr>
<tr>
<td class=tablebody2 height="20" width="20%"><font color='#333333'><b>你登录该FTP的用户名: </b></font></td>
<td class=tablebody1 height="20" ><%=uname%></td>
</tr>
<%if UseDvbbsUserNameAndPassword<>1 then%>
<tr>
<td class=tablebody2 height='20' width='200'><font color='#333333'><b>你登录该FTP的新密码:</b></font></td>
<td class=tablebody1 height=20 width=*><input type=password name="newpass" value=""> <font color=red>(注意:不能使用论坛密码)</font></td>
</tr>
<tr>
<td class=tablebody2 height=20 width=200><font color='#333333'><b>新密码确认:</b></font></td>
<td class=tablebody1 height=20 width=*><input type=password name="newrpass" value=""> <font color=red>(建议:每个FTP分别使用不同的随机密码,留空则生成随机密码)</font></td>
</tr>
<%else%>
<tr>
<td class=tablebody2 height=20 width=200><font color='#333333'><b>你登录该FTP的密码:</b></font></td>
<td class=tablebody1 height=20 width=*> <font color=red>论坛密码</font></td>
</tr>
<%end if%>
<tr>
<td class=tablebody2 colspan=2 height=20 align=center><input type=Submit value=" 激活 " name=Submit></td>
</tr>
</form>
</table>
<%
end sub
sub ShowFtp(ftpip,ftpid,allowip,maxdownsize,value)
dim dup,ddown,sup,sdown,lasttime,lastip,fup,fdown,logintimes
dim mrs,uname,ttime,sonline,upspeed,downspeed
dim arip
arip = split(dvbbs.usertrueip,".")
uname = Prefix & dvbbs.membername
on error resume next
dup = 0
ddown = 0
fup = 0
fdown = 0
logintimes = 0
upspeed = 0
downspeed = 0
if ftpip="default" then
set mrs = logconn.execute("select sum(KBUp) as KBUp, sum(KBDown) as KBDown,sum(LoginTimes) as LoginTimes, sum(DownTime) as DownTime, sum(Uptime) as Uptime,sum(FUp) as FUp,sum(FDown) as FDown from FtpLog_UserStatistic where UserName='"&uname&"'")
else
set mrs = logconn.execute("select * from FtpLog_UserStatistic where FTP='" & ftpip & "' and UserName='"&uname&"'")
end if
if not mrs.eof then
dup = mrs("KBUp") * 1024.0
ddown = mrs("KBDown") * 1024.0
fup = mrs("FUp")
fdown = mrs("FDown")
logintimes = mrs("LoginTimes")
'upspeed = mrs("UpTime")
'downspeed = mrs("DownTime")
if isnull(mrs("UpTime")) then
upspeed = 0
else
upspeed = cdbl(mrs("UpTime"))
end if
if isnull(mrs("DownTime")) then
downspeed = 0
else
downspeed = cdbl(mrs("DownTime"))
end if
if upspeed>0 then
upspeed = dup/upspeed
end if
if downspeed>0 then
downspeed = ddown/downspeed
end if
end if
set mrs=nothing
'sup = FileSizeStr(dup)
'sdown = FileSizeStr(ddown)
lastip = "0.0.0.0"
lasttime = 0
if ftpip="default" then
set mrs=logconn.execute("select * from FtpLog_UserLastLogin where UserName='"&uname&"' order by LastTime desc")
else
set mrs=logconn.execute("select * from FtpLog_UserLastLogin where FTP='"&ftpip&"' and UserName='"&uname&"' order by LastTime desc")
end if
if not mrs.eof then
lasttime = mrs("LastTime")
lastip = mrs("IP")
end if
set mrs = nothing
if ftpip="default" then
set mrs=logconn.execute("select count(*) from FTPUserOnline where UserName='"&uname&"'")
else
set mrs=logconn.execute("select count(*) from FTPUserOnline where FTP='"&ftpip&"' and UserName='"&uname&"'")
end if
if mrs(0)>0 then
sonline ="<font color=blue>在线</font>"
else
sonline ="<font color=red>离线</font>"
end if
set mrs = nothing
%>
<form action="ftpunion.asp" method=post name="FORM">
<table cellpadding=0 cellspacing=1 align=center class=tableborder1>
<tr>
<th height=25 colspan=2 align=center><b>帐户信息</b> -==[<%=sonline%>]==-</th>
</tr>
<tr>
<td height=20 class=tablebody2 width=200><font color=#333333><b>你共上传:</b></font></td>
<td class=tablebody1 width=*><%=dup%> Bytes <font color=red>(大约 <%=FileSizeStr(dup)%>)</font> 文件 <%=fup%> 个 [平均速度<%=filesizestr(upspeed)%>/S]</td>
</tr>
<tr>
<td height=20 class=tablebody2 width=200><font color=#333333><b>你共下载:</b></font></td>
<td class=tablebody1 width=*><%=ddown%> Bytes <font color=red>(大约 <%=FileSizeStr(ddown)%>)</font> 文件 <%=fdown%> 个 [平均速度<%=filesizestr(downspeed)%>/S]</td>
</tr>
<tr>
<td height=20 class=tablebody2 width=200><font color=#333333><b>登录次数:</b></font></td>
<td class=tablebody1 width=*><%=logintimes%></td>
</tr>
<tr>
<td height=20 class=tablebody2 width=200><font color=#333333><b>最后登录时间:</b></font></td>
<td class=tablebody1 width=*><%=LastTime%></td>
</tr>
<tr>
<td height=20 class=tablebody2 width=200><font color=#333333><b>最后登录IP:</b></font></td>
<td class=tablebody1 width=*><%=lastip%></td>
</tr>
<tr>
<td height=20 class=tablebody2 width=200><font color=#333333><b>账号状态:</b></font></td>
<td class=tablebody1 width=*><%=ustatus%></td>
</tr>
<tr>
<th height=25 colspan=2 align=center><b>购买下载量</b></th>
</tr>
<tr>
<td height=20 class=tablebody2 width=200><font color=#333333><b>你的预购下载量:</b></font></td>
<td class=tablebody1 width=*><%=maxdownsize%> Bytes <font color=red>(大约 <%=FileSizeStr(maxdownsize)%> ) </font></td>
</tr>
<tr>
<td height=20 class=tablebody2><font color=#333333><b>单价:</b></font></td>
<td class=tablebody1><%=value%> 单位/<%=BuyUnit%> </td>
</tr>
<tr>
<td height=20 class=tablebody2><font color=#333333><b>购买量:</b></font></td>
<td class=tablebody1>
<input type=text name="buyvalue" value=0> <%=BuyUnit%> <font color=red>(你最多可以购买 <%=FormatNumber(GetGold()/value,1,true)%> <%=BuyUnit%>)
<input type=hidden name="action" value="buysave">
<input type=hidden name="ftpid" value="<%=ftpid%>">
</td></tr>
</table>
</td></tr>
<tr><td>
<table cellpadding=0 cellspacing=1 align=center class=tableborder1>
<tr>
<%if 1 <> UseDvbbsUserNameAndPassword then%>
<th height=25 colspan=2 align=center><b>修改密码</b><font color=red>(不能查旧密码,只能修改新密码,留空表示不修改)</font></th>
<%else
if 1 = UseDvbbs7Database then%>
<th height=25 colspan=2 align=center><b>FTP账号信息信息</b></th>
<%else%>
<th height=25 colspan=2 align=center><b>密码同步更新</b></th>
<%end if
end if%>
</tr>
<tr>
<td height=20 class=tablebody2 width=200><font color=#333333><b>你登录该FTP的用户名:</b></font></td>
<td class=tablebody1 width=*><%=uname%></td>
</tr>
<%if UseDvbbsUserNameAndPassword<>1 then%>
<tr>
<td height=20 class=tablebody2><font color=#333333><b>你登录该FTP的新密码:</b></font></td>
<td class=tablebody1><input type=password name="newpass" value=""> </td>
</tr>
<tr>
<td height=20 class=tablebody2><font color=#333333><b>新密码确认:</b></font></td>
<td class=tablebody1><input type=password name="newrpass" value=""> </td>
</tr>
<%else%>
<tr>
<td height=20 class=tablebody2><font color=#333333><b>你登录该FTP的密码:</b></font></td>
<td class=tablebody1> <font color=red>论坛密码</font></td>
</tr>
<%end if%>
</table>
</td></tr>
<tr><td>
<table cellpadding=0 cellspacing=1 align=center class=tableborder1>
<tr>
<th height=25 align=center><b>修改允许的 IP 段</b><font color=red>(必须填入,你现在的 IP 是:<%=dvbbs.usertrueip%>)</font></th>
</tr>
<tr>
<td class=tablebody1><b>说明:</b><br>
<li>你如果要允许一个 IP,可以直接输入 IP 地址在这里,输入: <%=dvbbs.usertrueip%><br>
<li>如果你要允许一个 C 类网,那么你可以不输入 IP 的最后一位,输入:<%=arip(0)&"."&arip(1)&"."&arip(2)%>.*<br>
<li>如果你要允许一个 B 类网,那么你可以不输入 IP 的最后两位,输入:<%=arip(0)&"."&arip(1)%>.*<br>
<li>如果你要允许一个 A 类网,那么你可以不输入 IP 的最后三位,输入:<%=arip(0)%>.*<br>
<li>注意上面的写法,如果允许的是一个 C 类或者 B 类网,请最后保留点号(.*),切记!<br>
<li>如果要允许一个 IP 范围 ,如 如1:202.*.11?.12-35 <br>
<li>至于输入整个IP或者B、C类网,就看你实际情况了
</td>
</tr>
<tr>
<td height=25 class=tablebody2 align=center><input type=text size=65 name="allowip" value='<%=allowip%>'></textarea>
</td></tr>
<tr>
<td height=25 class=tablebody1 align=center>
<input type=Submit value="购买流量/更新信息" name=Submit"> <font color=red>[只更新帐号密码、允许IP信息,请购买0]</font>
</td></tr>
</table>
</form>
</td></tr>
</table>
<br>
<%
end sub
function GetBbsUserPassword(userid)
dim mrs
set mrs=dvbbs.execute("select userpassword from dv_user where userid="&userid)
GetBbsUserpassword = mrs(0)
end function
function GetUserPower(userid)
dim trs
set trs=Dvbbs.Execute("select userpower from dv_user where userid=" & userid)
if trs.eof and trs.bof then
GetUserPower = 0
else
GetUserPower = clng(trs(0))
end if
set trs = nothing
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -