<!-- #include file="../conn.asp" -->
<!-- #include file="../cls_main.asp" -->
<!-- #include file="../cls_ishion_showPage.asp" -->
<!-- #include file="../cls_md5.asp" -->
<% MyDbPath = "../"
dim obj
set obj = New admin_user_ftp
	obj.AspInit()
set obj = nothing

Class admin_user_ftp

	Private isEdit, y, BatchID, sID, ishion
	Private Sub Class_Initialize()
		Set ishion = New Cls_Main
	End Sub
	Private Sub Class_Terminate()
		Set ishion = Nothing
	End Sub
	Public Sub AspInit()
		Response.Write "<HTML><HEAD><TITLE>Serv-U FTP Server 用户管理</TITLE>" & vbCrLf
		Response.Write "<META http-equiv=Content-Type content=""text/html; charset=gb2312"">" & vbCrLf
		Response.Write "<LINK href=""admin.css"" type=text/css rel=stylesheet>" & vbCrLf
		Response.Write "</HEAD>" & vbCrLf
		Response.Write "<BODY leftmargin=""1"" topmargin=""1"">" & vbCrLf
	
		BatchID = Request.Form("ID")
		If Request.QueryString("ID") <> "" Then
			sID = CLng(Request.QueryString("ID"))
		Else
			sID = ""
		End If
		isEdit = False

			If ishion.adminName = "" Then
				ishion.strMsg = "<li>非法操作：登录超时或你没有以管理员身份登录系统，<a href=""../admin_login.asp"" target=_top>点此进入管理员登录界面</a>。"
				Call ishion.SystemMsg
			ElseIf ishion.checkPermission(ishion.adminName, "52") = False Then
				ishion.strMsg = "<li>非法操作：你没有权限进行此项操作，请联系管理员！"
				Call ishion.SystemMsg
			Else
				Call Main
			End If
	
	End Sub
	Private Sub Main()
		If ishion.F469e80d32(4) <> "1" Then
			ishion.strMsg = "Serv-U FTP 管理系统模块未注册。"
			Call ishion.SystemMsg
			Exit Sub
		End If
		Select Case Trim(Request("action"))
		Case "isBatchDel" '批量删除
			Call isBatchDel
		Case "isBatchDisable" '批量禁用
			Call isBatchDisable
		Case "isBatchEnable" '批量启用
			Call isBatchEnable
		Case "isDel" '删除
			Call isDel
		Case "edit"
			Call edit
		Case "save"
			Call saveedit
		Case Else
			Call showList
		End Select
	End Sub

	Private Sub saveedit()
		Dim Rs, sql
		if Not IsObject(Conn) then Call ConnectionDatabase
		sID = Trim(Request.Form("ID"))
		Set Rs = Server.CreateObject("adodb.recordset")
		sql = "Select * from ftp_UserAccounts where ID=" & sID
		Rs.open sql, Conn, 1, 3
		'Rs("ishion_UserName")       = Trim(Request.Form("ishion_UserName"))
		'If Trim(Request.Form("Name"))<> Rs("Name") then
			'ishion.Execute("Update ftp_UserDirAccess Set Name='" & ishion.checkStr(Request.Form("Name")) & "' where Name='" & Rs("Name") & "'")
			'ishion.Execute("Update ftp_UserIPAccess Set Name='" & ishion.checkStr(Request.Form("Name")) & "' where Name='" & Rs("Name") & "'")
			'Rs("Name")     = Trim(Request.Form("Name"))
		'End If
		'If Trim(Request.Form("Password"))<>Rs("Password") then
			'Rs("Password") = ishion.ftpPassword(Trim(Request.Form("Password")))
			'Rs("ishion_Password")   = ishion.Md5(Trim(Request.Form("Password")))
		'End if
		Rs("Access") = Trim(Request.Form("Access_Dir")) & "|" & Replace(Replace(Trim(Request.Form("Access")), ",", ""), " ", "")
		Rs("HomeDir") = Trim(Request.Form("HomeDir"))
		Rs("LogMesFile") = Trim(Request.Form("LogMesFile"))
		Rs("Disable") = Trim(Request.Form("Disable"))
		If Trim(Request.Form("RelPaths")) = "-1" Then
			Rs("RelPaths") = -1
		Else
			Rs("RelPaths") = 0
		End If
		If Trim(Request.Form("HideHidden")) = "-1" Then
			Rs("HideHidden") = -1
		Else
			Rs("HideHidden") = 0
		End If
		If Trim(Request.Form("AlwaysLogin")) = "1" Then
			Rs("AlwaysLogin") = 1
		Else
			Rs("AlwaysLogin") = 0
		End If
		If Trim(Request.Form("MaxUsers")) = "" Then
			Rs("MaxUsers") = -1
		Else
			Rs("MaxUsers") = Int(Request.Form("MaxUsers"))
		End If
		If Trim(Request.Form("MaxSpeedUp")) = "" Then
			Rs("MaxSpeedUp") = -1
		Else
			Rs("MaxSpeedUp") = Int(Request.Form("MaxSpeedUp")) * 1024
		End If
		If Trim(Request.Form("MaxSpeedDown")) = "" Then
			Rs("MaxSpeedDown") = -1
		Else
			Rs("MaxSpeedDown") = Int(Request.Form("MaxSpeedDown")) * 1024
		End If
		If Trim(Request.Form("MaxIP")) = "" Then
			Rs("MaxIP") = -1
		Else
			Rs("MaxIP") = Int(Request.Form("MaxIP"))
		End If
		If Trim(Request.Form("IdleTimeOut")) = "" Then
			Rs("IdleTimeOut") = 0
		Else
			Rs("IdleTimeOut") = Int(Request.Form("IdleTimeOut")) * 60
		End If
		If Trim(Request.Form("SessionTimeOut")) = "" Then
			Rs("SessionTimeOut") = 0
		Else
			Rs("SessionTimeOut") = Int(Request.Form("SessionTimeOut")) * 60
		End If
	
		If Trim(Request.Form("QuotaEnable")) = "1" Then
			Rs("QuotaEnable") = 1
		Else
			Rs("QuotaEnable") = 0
		End If
		''Rs("QuotaCurrent")    = Int(Request.Form("QuotaCurrent"))*1024*1024
		Rs("QuotaMax") = Int(Request.Form("QuotaMax")) * 1024 * 1024
		Rs("RatioType") = Trim(Request.Form("RatioType"))
		Rs("RatioUp") = Trim(Request.Form("RatioUp"))
		Rs("RatioDown") = Trim(Request.Form("RatioDown"))
		Rs("RatioCredit") = Trim(Request.Form("RatioCredit"))
		Rs("Expiration") = Trim(Request.Form("Expiration"))
		Rs.Update
		Rs.Close
		Set Rs = Nothing
		ishion.strMsg = "保存修改操作完成。"
		Call ishion.SystemMsg
	End Sub
	Private Sub isDel()
		If sID <> "" Then
			'删除前先删除用户文件夹
			ishion.DeletePath (ishion.Execute("select HomeDir from ftp_UserAccounts where ID=" & sID)(0))
			ishion.Execute ("delete from ftp_UserAccounts where ID=" & sID)
			ishion.strMsg = "<li>“帐号删除”操作成功！</li>"
		Else
			ishion.strMsg = "<li>没有作选择任何，本次操作被取消！</li>"
		End If
		Call ishion.SystemMsg
	End Sub
	Private Sub isBatchDel()
		If BatchID <> "" Then
			
			'删除前先删除用户文件夹
			If Trim(Request.Form("deletePath")) = "yes" Then
				Dim i
				For i = 0 To UBound(Split(BatchID, ","))
					ishion.DeletePath (ishion.Execute("select HomeDir from ftp_UserAccounts where ID=" & Split(BatchID, ",")(i))(0))
				Next
			End If
			ishion.Execute ("delete from ftp_UserAccounts where ID in (" & BatchID & ")")
			ishion.strMsg = "<li>“批量删除”操作成功！</li>"
		Else
			ishion.strMsg = "<li>没有作选择任何，本次操作被取消！</li>"
		End If
		Call ishion.SystemMsg
	End Sub
	Private Sub isBatchDisable()
		If BatchID <> "" Then
			ishion.Execute ("update ftp_UserAccounts set Disable = -1 where ID in (" & BatchID & ")")
			ishion.strMsg = "<li>“批量禁用”操作成功！</li>"
		Else
			ishion.strMsg = "<li>没有作选择任何，本次操作被取消！</li>"
		End If
		Call ishion.SystemMsg
	End Sub
	Private Sub isBatchEnable()
		If BatchID <> "" Then
			ishion.Execute ("update ftp_UserAccounts set Disable = 0 where ID in (" & BatchID & ")")
			ishion.strMsg = "<li>“批量启用”操作成功！</li>"
		Else
			ishion.strMsg = "<li>没有作选择任何，本次操作被取消！</li>"
		End If
		Call ishion.SystemMsg
	End Sub
	Private Sub showList()
		Dim sColumn, showPageRs, strSQL, Rs, q, i, currentPage
		If Trim(Request.QueryString("Page")) = "" Then
			currentPage = 1
		Else
			currentPage = Trim(Request.QueryString("Page"))
		End If
		strSQL = ""
		sColumn = "ID,ishion_UserName,Name,MaxUsers,MaxSpeedUp,MaxSpeedDown,MaxIP,Disable"
		If Trim(Request("name")) <> "" Then
			strSQL = "Name like '%" & ishion.checkStr(Trim(Request("name"))) & "%' or ishion_UserName like '%" & ishion.checkStr(Trim(Request("name"))) & "%'"
			q = " & name=" & Trim(Request("name"))
		End If
		Set showPageRs = New cls_ishion_showPage '创建对象
			If IsSqlDataBase = 1 Then
				showPageRs.DbType = "MSSQL"
			Else
				showPageRs.DbType = "AC"
			End If
			'数据库类型,AC为access,MSSQL为sqlserver2000,MSSQL_SP为存储过程版,MYSQL为mysql,PGSQL为PostgreSql
			showPageRs.RecType = 0
			'取记录总数方法(0执行count,1自写sql语句取,2固定值)
			showPageRs.RecSql = 0
			'如果RecType＝1则=取记录sql语句，如果是2=数值，等于0=""
			showPageRs.RecTerm = 2
			'取从记录条件是否有变化(0无变化,1有变化,2不设置cookies也就是及时统计，适用于搜索时候)
			showPageRs.CookieName = "ftplist" '如果RecTerm＝2,cookiesname="",否则写cookiesname
			showPageRs.Order = 0              '排序(0顺序1降序),注意要和下面sql里面主键ID的排序对应
			showPageRs.PageSize = 30          '每页记录条数
			showPageRs.currentPage = currentPage
			showPageRs.sql = sColumn & "$ftp_UserAccounts$" & strSQL & "$Name$Name" '字段,表,条件(不需要where),排序(不需要需要ORDER BY),主键ID
		Dim iRecCount, sqlRs
		
		iRecCount = showPageRs.RecCount() '记录总数
		
		
		Response.Write "<table width=""99%""  border=""0"" cellspacing=""1"" cellpadding=""3"">" & vbCrLf
		Response.Write "<form action="""" method=""post"" name=""form1"">  <tr>" & vbCrLf
		Response.Write "    <td align=""center"">查找用户：" & vbCrLf
		Response.Write "      <input name=""name"" type=""text"" id=""name"" value=""" & Trim(Request("name")) & """>" & vbCrLf
		Response.Write "       <input type=""submit"" name=""Submit"" value="" 查找 ""></td>" & vbCrLf
		Response.Write "  </tr></form>" & vbCrLf
		Response.Write "</table>" & vbCrLf
		Response.Write "<table width=""99%"" border=""0"" cellpadding=""4"" cellspacing=""1"" bgcolor=""#CCCCCC"">" & vbCrLf
		If iRecCount > 0 Then
			Response.Write "<tr bgcolor=""#FFFFFF""><td colspan=""9"">" & showPageRs.showPage("?Page={$pages}" & q) & "</td></tr>"
		End If
		Response.Write "<form name=""myform"" method=""post"" action="""">" & vbCrLf
		Response.Write "        <tr align=""center""  bgcolor=""#EFEFEF"">" & vbCrLf
		Response.Write "          <td><a href=""javascript:SelectAll()"">选择</a></td> " & vbCrLf
		Response.Write "          <td>ftp Owner</td>" & vbCrLf
		Response.Write "          <td>UserName</td>" & vbCrLf
		Response.Write "          <td bgcolor=""#EFEFEF"">MaxUsers</td>" & vbCrLf
		Response.Write "          <td>MaxSpeedUp</td>" & vbCrLf
		Response.Write "          <td>MaxSpeedDown</td>" & vbCrLf
		Response.Write "          <td>MaxIP</td>" & vbCrLf
		Response.Write "          <td>启用/禁用</td>" & vbCrLf
		Response.Write "          <td>管理操作</td>" & vbCrLf
		Response.Write "        </tr>       " & vbCrLf
		If iRecCount < 1 Then
			Response.Write "<tr bgcolor=""#FFFFFF""><td colspan=""9"">Sorry！没有找到任何记录。</td></tr>"
		Else
			Set sqlRs = showPageRs.ResultSet()  '返回ResultSet
			Rs = sqlRs.GetRows(-1)
			For i = 0 To UBound(Rs, 2)
			Response.Write "    <tr bgcolor=""#FFFFFF"">"
			Response.Write "      <td align=""center""><input name=""ID"" type=""checkbox"" value=""" & Rs(0, i) & """></td>"
			Response.Write "      <td>" & Rs(1, i) & "</td>"
			Response.Write "      <td>" & Rs(2, i) & "</td>"
			Response.Write "      <td>" & Rs(3, i) & "</td>"
			Response.Write "      <td>" & Int(Rs(4, i) / 1024) & " KB/Sec</td>"
			Response.Write "      <td>" & Int(Rs(5, i) / 1024) & " KB/Sec</td>"
			Response.Write "      <td>" & Rs(6, i) & "</td>"
			Response.Write "      <td>"
			If Rs(7, i) Then
				Response.Write ("禁用")
			Else
				Response.Write ("启用")
			End If
			Response.Write "</td>"
			Response.Write "      <td align=""center""><a href=""?action=edit&ID=" & Rs(0, i) & """>编辑</a> <a href=""?action=isDel&ID=" & Rs(0, i) & """>删除</a></td>"
			Response.Write "   </tr>"
			Next
			Rs = Null
			Set sqlRs = Nothing
		End If
		
		'Response.Write "        <tr bgcolor=""#FFFFFF""><td colspan=""9""><input type=checkbox name=chkall value=on onclick=""CheckAll(this.form)"" id=""chkall""><label for=""chkall"">全选</label>　管理：<input type=""radio"" name=""action"" value=""isBatchDel"">批量<font color=red>删除</font>" & vbCrlf
		'Response.Write "              <input name=""deletePath"" type=""checkbox"" id=""deletePath"" value=""yes"" checked>同时删除用户文件夹" & vbCrlf
		'Response.Write "        " & vbCrlf
		'Response.Write "           <input type=""radio"" name=""action"" value=""isBatchEnable"">批量<font color=blue>启用</font>" & vbCrlf
		'Response.Write "           <input type=""radio"" name=""action"" value=""isBatchDisable"">批量<font color=blue>禁用</font>" & vbCrlf
		'Response.Write "           <input type=""submit"" name=""Submit3"" value=""执行操作"" onclick=""{if(confirm('您确定执行的操作吗?')){this.document.myform.submit();return true;}return false;}"">" & vbCrlf
		'Response.Write "           </td></tr>" & vbCrlf
		Response.Write "</form>" & vbCrLf
		If iRecCount > 0 Then
			Response.Write "<tr bgcolor=""#FFFFFF""><td colspan=""9"">" & showPageRs.showPage("?Page={$pages}" & q) & "</td></tr>"
		End If
		Response.Write "</table>" & vbCrLf
		Set showPageRs = Nothing
		
	End Sub
	Private Sub edit()
		Response.Write "<SCRIPT language = ""JavaScript"">" & vbCrLf
		Response.Write "//parent.frame.cols=""0,*"";" & vbCrLf
		Response.Write "function SelectAll() {" & vbCrLf
		Response.Write "    for (var i=0;i<document.myform.ID.length;i++) {" & vbCrLf
		Response.Write "        var e=document.myform.ID[i];" & vbCrLf
		Response.Write "        e.checked=!e.checked;" & vbCrLf
		Response.Write "    }" & vbCrLf
		Response.Write "}" & vbCrLf
		Response.Write "<!--" & vbCrLf
		Response.Write "function CheckAll(form)  {" & vbCrLf
		Response.Write "  for (var i=0;i<form.elements.length;i++)    {" & vbCrLf
		Response.Write "    var e = form.elements[i];" & vbCrLf
		Response.Write "    if (e.name != 'chkall')       e.checked = form.chkall.checked; " & vbCrLf
		Response.Write "   }" & vbCrLf
		Response.Write "  }" & vbCrLf
		Response.Write "//-->" & vbCrLf
		Response.Write "</script>" & vbCrLf
		Dim Rs, Access_Dir, Access
		Set Rs = ishion.Execute("select * from ftp_UserAccounts where id=" & sID)
		If Rs("Access") <> "" Then
			Access_Dir = Split(Rs("Access"), "|")(0)
			Access = Split(Rs("Access"), "|")(1)
		Else
			Access_Dir = ""
			Access = ""
		End If
		Response.Write "<script language=""JavaScript"" src=""../js/MyUserinfo.js""></script>" & vbCrLf
		Response.Write "<table width=""99%""  border=""0"" cellpadding=""3"" cellspacing=""1"" bgcolor=""#CCCCCC"">" & vbCrLf
		Response.Write "  <form name=""form1"" method=""post"" action=""?action=save""><input name=""ID"" type=""hidden"" value=""" & Rs("ID") & """>" & vbCrLf
		Response.Write "    <tr align=""center"" bgcolor=""#EFEFEF"">" & vbCrLf
		Response.Write "      <td colspan=""2"">Serv-U 用户帐号设置</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">ftp Owner</td>" & vbCrLf
		Response.Write "      <td><input name=""ishion_UserName"" type=""text"" id=""ishion_UserName"" value=""" & Rs("ishion_UserName") & """ size=""45"" maxlength=""15""> 所有人</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Account</td>" & vbCrLf
		Response.Write "      <td><input name=""Name"" type=""text"" id=""Name"" value=""" & Rs("Name") & """ size=""45"" maxlength=""30""> 登录帐号</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Password</td>" & vbCrLf
		Response.Write "      <td><input name=""Password"" type=""text"" id=""Password"" value=""" & Rs("ishion_Password") & """ size=""45"" maxlength=""30"" style=""FONT-SIZE: 12px;FONT-FAMILY:Verdana;""> 登录密码</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right""> Default dir</td>" & vbCrLf
		Response.Write "      <td><input name=""Access_Dir"" type=""text"" id=""Access_Dir"" value=""" & Access_Dir & """ size=""45"" maxlength=""50"">" & vbCrLf
		Response.Write "        默认目录</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Dir IP access rule</td>" & vbCrLf
		Response.Write "      <td><input name=""Access"" type=""checkbox"" id=""Access"" value=""R"" "
		If InStr(Access, "R") > 0 Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "        R = 读取 read access<br>" & vbCrLf
		Response.Write "        <input name=""Access"" type=""checkbox"" id=""Access"" value=""W"" "
		If InStr(Access, "W") > 0 Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "        W = 写入 write access<br>" & vbCrLf
		Response.Write "        <input name=""Access"" type=""checkbox"" id=""Access"" value=""A"" "
		If InStr(Access, "A") > 0 Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "        A = 追加 append access<br>" & vbCrLf
		Response.Write "        <input name=""Access"" type=""checkbox"" id=""Access"" value=""M"" "
		If InStr(Access, "M") > 0 Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "        M = 修改 modify access<br>" & vbCrLf
		Response.Write "        <input name=""Access"" type=""checkbox"" id=""Access"" value=""C"" "
		If InStr(Access, "C") > 0 Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "        C = 创建 create directory access<br>" & vbCrLf
		Response.Write "        <input name=""Access"" type=""checkbox"" id=""Access"" value=""D"" "
		If InStr(Access, "D") > 0 Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "        D = 删除 delete directory access<br>" & vbCrLf
		Response.Write "        <input name=""Access"" type=""checkbox"" id=""Access"" value=""L"" "
		If InStr(Access, "L") > 0 Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "        L = 列表 list directory access<br>" & vbCrLf
		Response.Write "        <input name=""Access"" type=""checkbox"" id=""Access"" value=""E"" "
		If InStr(Access, "E") > 0 Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "        E = 执行 execute program access<br>" & vbCrLf
		Response.Write "        <input name=""Access"" type=""checkbox"" id=""Access"" value=""P"" "
		If InStr(Access, "P") > 0 Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "        P = 继承 inherit rule to sub-directories</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Home directory</td>" & vbCrLf
		Response.Write "      <td><input name=""HomeDir"" type=""text"" id=""HomeDir"" value=""" & Rs("HomeDir") & """ size=""45"" maxlength=""50"">" & vbCrLf
		Response.Write "        主目录</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Login message file</td>" & vbCrLf
		Response.Write "      <td><input name=""LogMesFile"" type=""text"" id=""LogMesFile"" value=""" & Rs("LogmesFile") & """ size=""45"" maxlength=""50"">" & vbCrLf
		Response.Write "        登录消息文件</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Account enable/disable</td>" & vbCrLf
		Response.Write "      <td><input name=""Disable"" type=""radio"" value=""0"" "
		If Not Rs("Disable") Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "        启用        <input type=""radio"" name=""Disable"" value=""-1"" "
		If Rs("Disable") Then
			Response.Write ("checked")
		End If
		Response.Write ">        " & vbCrLf
		Response.Write "      禁用</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Lock user in homedir</td>" & vbCrLf
		Response.Write "      <td><input name=""RelPaths"" type=""checkbox"" id=""RelPaths"" value=""-1"" "
		If Rs("RelPaths") Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "        锁定于主目录</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Hide hidden files</td>" & vbCrLf
		Response.Write "      <td><input name=""HideHidden"" type=""checkbox"" id=""HideHidden"" value=""-1"" "
		If Rs("HideHidden") Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "        隐藏系统或隐藏文件</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Always allow login</td>" & vbCrLf
		Response.Write "      <td><input name=""AlwaysLogin"" type=""checkbox"" id=""AlwaysLogin"" value=""1"" "
		If Rs("AlwaysLogin") Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "        总是允许登录，即使已到达用户期限。</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Maximum concurrent users</td>" & vbCrLf
		Response.Write "      <td><input name=""MaxUsers"" type=""text"" id=""MaxUsers"" maxlength=""3"" value="""
		If Rs("MaxUsers") = -1 Then
			Response.Write ("")
		Else
			Response.Write (Rs("MaxUsers"))
		End If
		Response.Write """>" & vbCrLf
		Response.Write "        最大并发用户</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Maximum uplink speed</td>" & vbCrLf
		Response.Write "      <td><input name=""MaxSpeedUp"" type=""text"" id=""MaxSpeedUp"" maxlength=""8"" value="""
		If Rs("MaxSpeedUp") = -1 Then
			Response.Write ("")
		Else
			Response.Write (Rs("MaxSpeedUp") / 1024)
		End If
		Response.Write """><font color=blue>KB/秒</font>" & vbCrLf
		Response.Write "        每链最大上传速度</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Maximum downlink speed</td>" & vbCrLf
		Response.Write "      <td><input name=""MaxSpeedDown"" type=""text"" id=""MaxSpeedDown"" maxlength=""8"" value="""
		If Rs("MaxSpeedDown") = -1 Then
			Response.Write ("""")
		Else
			Response.Write (Rs("MaxSpeedDown") / 1024)
		End If
		Response.Write """><font color=blue>KB/秒</font>" & vbCrLf
		Response.Write "        每链最大下载速度</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Maximum user from IP</td>" & vbCrLf
		Response.Write "      <td><input name=""MaxIP"" type=""text"" id=""MaxIP"" maxlength=""3"" value="""
		If Rs("MaxIP") = -1 Then
			Response.Write ("")
		Else
			Response.Write (Rs("MaxIP"))
		End If
		Response.Write """>" & vbCrLf
		Response.Write "        同一IP最大用户数</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Idle time-out</td>" & vbCrLf
		Response.Write "      <td> <input name=""IdleTimeOut"" type=""text"" id=""IdleTimeOut"" maxlength=""5"" value="""
		If Rs("IdleTimeOut") = 0 Then
			Response.Write ("")
		Else
			Response.Write (Rs("IdleTimeOut") / 60)
		End If
		Response.Write """><font color=blue>分钟</font>" & vbCrLf
		Response.Write "        空闲超时（默认：10分钟）</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Session time-out</td>" & vbCrLf
		Response.Write "      <td><input name=""SessionTimeOut"" type=""text"" id=""SessionTimeOut"" maxlength=""5"" value="""
		If Rs("SessionTimeOut") = 0 Then
			Response.Write ("")
		Else
			Response.Write (Rs("SessionTimeOut") / 60)
		End If
		Response.Write """><font color=blue>分钟</font>" & vbCrLf
		Response.Write "        进程超时（默认：空）</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Enable quota</td>" & vbCrLf
		Response.Write "      <td><input name=""QuotaEnable"" type=""checkbox"" id=""QuotaEnable"" value=""1"" "
		If Rs("QuotaEnable") Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "        允许配额</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Current disk quota</td>" & vbCrLf
		Response.Write "      <td><input name=""QuotaCurrent"" type=""text"" id=""QuotaCurrent"" maxlength=""10"" value=""" & Rs("QuotaCurrent") / 1024 / 1024 & """><font color=blue>MB</font>" & vbCrLf
		Response.Write "        当前磁盘配额（0为无限制）</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Maximum disk quota</td>" & vbCrLf
		Response.Write "      <td><input name=""QuotaMax"" type=""text"" id=""QuotaMax"" maxlength=""10"" value=""" & Rs("QuotaMax") / 1024 / 1024 & """><font color=blue>MB</font>" & vbCrLf
		Response.Write "        最大磁盘配额（0为无限制）</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Account expiration date</td>" & vbCrLf
		Response.Write "      <td><input name=""Expiration"" type=""text"" maxlength=""12"" value=""" & Rs("Expiration") & """ onfocus=""show_cele_date(Expiration,'','',Expiration)"" >" & vbCrLf
		Response.Write "        帐号到期日期（1980-1-1为无限期）</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "  <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "    <td align=""right"">Ratio type</td>" & vbCrLf
		Response.Write "    <td> <input type=""radio"" name=""RatioType"" value=""0"" "
		If Rs("RatioType") = 0 Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "      0 = 不启用上传/下载比率<br>" & vbCrLf
		Response.Write "      <input type=""radio"" name=""RatioType"" value=""1"" "
		If Rs("RatioType") = 1 Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "      1 = 计数每个会话文件 count files-per-session<br>" & vbCrLf
		Response.Write "      <input type=""radio"" name=""RatioType"" value=""2"" "
		If Rs("RatioType") = 2 Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "      2 = 计数每个会话字节 count bytes-per-session<br>" & vbCrLf
		Response.Write "      <input type=""radio"" name=""RatioType"" value=""3"" "
		If Rs("RatioType") = 3 Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "      3 = 计数所有会话文件 count files-over-all-sessions<br>" & vbCrLf
		Response.Write "      <input type=""radio"" name=""RatioType"" value=""4"" "
		If Rs("RatioType") = 4 Then
			Response.Write ("checked")
		End If
		Response.Write ">" & vbCrLf
		Response.Write "      4 = 计数所有会话字节 count bytes-over-all-sessions</td>" & vbCrLf
		Response.Write "  </tr>" & vbCrLf
		Response.Write "  <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "    <td align=""right"">Upload ratio</td>" & vbCrLf
		Response.Write "    <td><input name=""RatioUp"" type=""text"" maxlength=""15"" value=""" & Rs("RatioUp") & """>" & vbCrLf
		Response.Write "      上传率</td>" & vbCrLf
		Response.Write "  </tr>" & vbCrLf
		Response.Write "  <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "    <td align=""right"">Download ratio</td>" & vbCrLf
		Response.Write "    <td><input name=""RatioDown"" type=""text"" maxlength=""15"" value=""" & Rs("RatioDown") & """>" & vbCrLf
		Response.Write "      下载率</td>" & vbCrLf
		Response.Write "  </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">Ratio credit</td>" & vbCrLf
		Response.Write "      <td><input name=""RatioCredit"" type=""text"" maxlength=""15"" value=""" & Rs("RatioCredit") & """><font color=blue>KB</font>或者<font color=blue>个</font> 信任度</td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "    <tr bgcolor=""#FFFFFF"">" & vbCrLf
		Response.Write "      <td align=""right"">&nbsp;</td>" & vbCrLf
		Response.Write "      <td><input type=""submit"" name=""Submit"" value=""提交""></td>" & vbCrLf
		Response.Write "    </tr>" & vbCrLf
		Response.Write "  </form>" & vbCrLf
		Response.Write "</table>" & vbCrLf
		Set Rs = Nothing
	End Sub
	Public Sub OnEndPage()
		Response.Write ishion.CopyRight
	End Sub ' OnEndPage


End Class %>

