<%
Response.Expires = 0 
Response.ExpiresAbsolute = DEF_Now - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private" 
Response.CacheControl = "no-cache"

Function DisplayUserCenter

	Dim NewUrl
	NewUrl = DEF_BBS_HomeUrl
	If Left(NewUrl,3) = "../" or Left(NewUrl,3) = "..\" Then NewUrl = Mid(NewUrl,4)
	%>
	<script language=javascript>
	function sss(obj)
	{
		if(obj.style.display == "none")
		{
			obj.style.display = "block";
		}
		else
		{
			obj.style.display = "none";
		}
	}
	</script>
	<a href=<%=NewUrl%>default.asp><img src=<%=DEF_BBS_HomeUrl%>images/<%=GBL_DefineImage%>manage/bbsmanageDirectory.GIF border=0></a><br>
	<table align=center width=100% border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td><%If CheckSupervisorUserName = 1 Then%>
			<table width=100% height=20 border="0" cellspacing="0" cellpadding="0" onclick="javascript:sss(document.all.AssortManage);" style="cursor:hand"><tr><td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
			<img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			&nbsp; <b>分类管理中心</b></td></tr></table><img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			<span name=AssortManage ID=AssortManage>&nbsp; <a href=<%=NewUrl%>ForumCategory/ForumCategoryManage.asp>论坛分类管理</a><br>
			&nbsp; <a href=<%=NewUrl%>ForumCategory/ForumCategoryJoin.asp>添加论坛分类</a><br></span>

			<img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			<table width=100% height=20 border="0" cellspacing="0" cellpadding="0" onclick="javascript:sss(document.all.BoardManage);" style="cursor:hand"><tr><td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
			<img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			&nbsp; <b>版面管理中心</b></td></tr></table><img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			<span name=BoardManage ID=BoardManage>&nbsp; <a href=<%=NewUrl%>ForumBoard/ForumBoardManage.asp>论坛版面管理</a><br>
			&nbsp; <a href=<%=NewUrl%>ForumBoard/ForumBoardJoin.asp>添加论坛版面</a><br>
			&nbsp; <a href=<%=NewUrl%>ForumBoard/ForumBoardAssort.asp>论坛版面专区管理</a><br>
			&nbsp; <a href=<%=NewUrl%>ForumBoard/MakeBoardList.asp title=重新修复论坛总帖回复帖精华帖及其它重要信息>重做论坛列表及修复</a><br>
			&nbsp; <a href=<%=NewUrl%>ForumBoard/RepairYesterdayAnc.asp title=修复昨日发帖量>重新计算昨日发帖量</a><br></span>

			<img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			<table width=100% height=20 border="0" cellspacing="0" cellpadding="0" onclick="javascript:sss(document.all.UserManage);" style="cursor:hand"><tr><td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
			<img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			&nbsp; <b>用户管理中心</b></td></tr></table><img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			<span name=UserManage ID=UserManage>&nbsp; <a href=<%=NewUrl%>User/UserManage.asp title="论坛所有用户列表，提供强制修改及强制指定权限分配">论坛用户管理</a><br>
			&nbsp; <a href=<%=NewUrl%>User/UserSpecial.asp title="特殊用户包括版主，受屏蔽用户或待激活用户等等，详细请点击进入管理">[特殊用户管理]</a><br>
			&nbsp; <a href=<%=NewUrl%>User/UserJoin.asp title="强制添加一个新用户，即使前台关闭了注册功能">添加新用户</a><br>
			&nbsp; <a href=<%=NewUrl%>User/ClearOnlineUser.asp title=将所有在线用户暂时踢下线>清除在线用户</a><br>
			&nbsp; <a href=<%=NewUrl%>User/UserSetup.asp title="设定新用户注册的选项">用户注册参数设置</a><br>
			&nbsp; <a href=<%=NewUrl%>User/IPManage.asp><font color=008800 class=GreenFont title=允许屏蔽IP段或某个IP地址>IP地址屏蔽</font></a><br>
			&nbsp; <a href=<%=NewUrl%>User/DeleteForbidIPandUser.asp><font color=blue class=BlueFont title=某些屏蔽ＩＰ地址及屏蔽的用户或认证会员有到期期限，每天请手工执行一次，以作清除>解除到期特殊用户及IP</font></a><br>
			&nbsp; <a href=<%=NewUrl%>User/SendGroupMessage.asp>论坛短消息群发</a><br>
			&nbsp; <a href=<%=NewUrl%>User/SendMailList.asp>邮件发送及群发</a><br></span>

			<img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			<table width=100% height=20 border="0" cellspacing="0" cellpadding="0" onclick="javascript:sss(document.all.RepairManage);" style="cursor:hand"><tr><td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
			<img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			&nbsp; <b>论坛修复中心</b></td></tr></table><img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			<span name=RepairManage ID=RepairManage>&nbsp; <a href=<%=NewUrl%>BlockUpdate/BlockUpdate.asp>批量修复论坛数据</a><br>
			&nbsp; <a href=<%=NewUrl%>ForumBoard/MakeBoardList.asp title=重新修复论坛总帖回复帖精华帖及其它重要信息>重做论坛列表及修复</a><br>
			&nbsp; <a href=<%=NewUrl%>ForumBoard/RepairYesterdayAnc.asp title=修复昨日发帖量>重新计算昨日发帖量</a><br>
			&nbsp; <a href=<%=NewUrl%>SiteManage/DeleteAllTopAnnounce.asp title=清除总固顶帖>清除总固顶帖(带修复)</a><br>
			&nbsp; <a href=<%=NewUrl%>User/ClearOnlineUser.asp title=将所有在线用户暂时踢下线>清除在线用户</a><br>
			&nbsp; <a href=<%=NewUrl%>SiteManage/RepairSite.asp title="重新统计上传文件及用户数量，论坛在线人数(每个版面)"><Font color=Green class=GreenFont>在线会员</font><Font color=blue class=blueFont>附件</font><Font color=Red class=RedFont>用户</font>修复</a><br></span>

			<img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			<table width=100% height=20 border="0" cellspacing="0" cellpadding="0" onclick="javascript:sss(document.all.OtherManage);" style="cursor:hand"><tr><td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
			<img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			&nbsp; <b>附助管理中心</b></td></tr></table><img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			<span name=OtherManage ID=OtherManage>&nbsp; <a href=<%=NewUrl%>Default.asp title="论坛的基本信息查看，包括组件支持，论坛版本等信息">论坛基本信息一览</a><br>
			&nbsp; <a href=<%=NewUrl%>SiteManage/Space.asp title="查看数据库，上传文件及论坛总占用空间情况，需要时间可能较长">查看空间占用情况</a><br>
			&nbsp; <%
			If application(DEF_MasterCookies & "SiteEnableFlagzoieiu") = 1 or application(DEF_MasterCookies & "SiteDisbleWhyszoieiu") = "" Then%><a href=<%=NewUrl%>SiteManage/SiteOpenClose.asp?Flag=close>暂停论坛访问</a><%
			Else
			%><a href=<%=NewUrl%>SiteManage/SiteOpenClose.asp?Flag=open>开启论坛访问</a><%
			End If%><br>
			&nbsp; <a href=<%=NewUrl%>SiteManage/SiteReset.asp?Flag=open>重新启动论坛</a><br>
			&nbsp; <a href=<%=NewUrl%>SiteManage/SiteInfo.asp>站点信息及网站修复</a><br>
			&nbsp; <a href=<%=NewUrl%>SiteManage/SiteLink.asp>友情论坛管理</a><br>
			&nbsp; <a href=<%=NewUrl%>SiteManage/SiteSetup.asp><b>论坛参数设置</b></a><br>
			&nbsp; <a href=<%=NewUrl%>SiteManage/UploadSetup.asp>上传参数设置</a><br>
			&nbsp; <a href=<%=NewUrl%>SiteManage/UbbcodeSetup.asp>UBB编码参数设置</a><br>
			&nbsp; <a href=<%=NewUrl%>SiteManage/TempletManage.asp>论坛模板管理</a><br>
			&nbsp; <a href=<%=NewUrl%>SiteManage/SiteEditFile.asp>在线编辑及风格设定</a><br>
			&nbsp; &nbsp-<a href=<%=NewUrl%>SiteManage/SiteEditFileContent.asp?file=-1>编辑用户注册协议</a><br>
			&nbsp; &nbsp-<a href=<%=NewUrl%>SiteManage/SiteEditFileContent.asp?file=-3>编辑联系我们内容</a><br>
			&nbsp; <a href=<%=NewUrl%>SiteManage/ForumLog.asp><font color=Red class=RedFont>查看论坛日志</font></a><br>
			&nbsp; <a href=<%=NewUrl%>SiteManage/ForumLog.asp?clear=yes>清除两天前的论坛日志</a><br>
			&nbsp; <a href=<%=NewUrl%>BlockUpdate/BlockDelete.asp><font color=red class=RedFont>论坛数据批量删除</font></a><br>
			</span>

			<img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			<table width=100% height=20 border="0" cellspacing="0" cellpadding="0" onclick="javascript:sss(document.all.DBManage);" style="cursor:hand"><tr><td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
			<img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			&nbsp; <b>数据库管理中心</b></td></tr></table><img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			<span name=DBManage ID=DBManage>
			&nbsp; <a href=<%=NewUrl%>Database/ExecuteString.asp>直接执行SQL语句</a><br>
			&nbsp; <a href=<%=NewUrl%>Database/BackupDatabase.asp>数据库备份及压缩</a><br></span>

			<img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			<table width=100% height=20 border="0" cellspacing="0" cellpadding="0" onclick="javascript:sss(document.all.OtherLink);" style="cursor:hand"><tr><td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
			<img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			&nbsp; <b>其它链接</b></td></tr></table><img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			<span name=OtherLink ID=OtherLink>&nbsp; <a href=<%=DEF_BBS_HomeUrl%>User/BoardMaster/Default.asp><font color=blue Class=BlueFont>总版主管理界面</font></a><br>
			&nbsp; <a href=<%=DEF_BBS_HomeUrl%>Search/UploadList.asp>上传附件管理</a><br>
			&nbsp; <a href=<%=DEF_BBS_HomeUrl%>User/MyInfoBox.asp?AllPrinting=Yesing>短消息管理</a><br>
			&nbsp; <a href=<%=DEF_BBS_HomeUrl%>User/UserCollect.asp>收藏帖子管理</a><br>
			&nbsp; <a href=<%=DEF_BBS_HomeUrl%>User/SendMessage.asp>发布公告(不填接收人)</a><br></span>
			<%End If%>

			<img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			<table width=100% height=20 border="0" cellspacing="0" cellpadding="0" onclick="javascript:sss(document.all.Logout);" style="cursor:hand"><tr><td bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9>
			<img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			&nbsp; <b>安全退出</b></td></tr></table><img src=<%=DEF_BBS_HomeUrl%>images/null.gif width=2 height=4><br>
			<span name=Logout ID=Logout>&nbsp; <a href=<%=DEF_BBS_HomeUrl%>User/Login.asp?R=Yes>重新登录</a><br>
			&nbsp; <a href=<%=DEF_BBS_HomeUrl%>User/Logout.asp>退出管理员身份</a><br></span>
			</td>
	</tr>
	</table>
	<br><br>
<%

End Function

Function DisplayLoginForm
%>
	<script language="javascript">
	function submitonce(theform)
	{
		if (document.all||document.getElementById)
		{
			for (i=0;i<theform.length;i++)
			{
				var tempobj=theform.elements[i];
				if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
				tempobj.disabled=true;
			}
		}
	}
	</script>
<p>
<form action=<%=DEF_BBS_HomeUrl & DEF_ManageDir%>/Default.asp method="post" onSubmit="submitonce(this);">
	用户名: <input name=user type=text maxlength=20 size=22 value="<%=htmlencode(GBL_CHK_user)%>" class=fminpt><br>
	密　码: <input name=pass type=password maxlength=20 size=22 value="<%'=htmlencode(GBL_CHK_pass)%>" class=fminpt><br>
	有效期: <Select name=CkiExp>
				<option value="-1">无效
				<option value="365">一年
				<option value=1>一天
				<option value=2>两天
				<option value=7>一周
				<option value=31>一月
			</select> Cookie保留时间
	<br>验证码: <input name=ForumNumber maxlength=4 size=4 value="<%=htmlencode(Request("RndNumber"))%>" class=fminpt>
	请输入<img src=<%=DEF_BBS_HomeUrl%>User/number.asp?n=<%=timer%> align=middle width=32 height=12> [<a href=<%=DEF_BBS_HomeUrl%>User/help/help.asp#code>说明</a>]<p>
	<input name=submitflag type=hidden value="ddddls-+++">
	<input type=submit value="登录" class=fmbtn> <input type=reset value="取消" class=fmbtn>
</form>
<%

End Function

Function DisplayUserNavigate(str)

	Dim NewUrl
	NewUrl = DEF_BBS_HomeUrl
	If Left(NewUrl,3) = "../" or Left(NewUrl,3) = "..\" Then NewUrl = Mid(NewUrl,4)
	If DEF_SiteHomeUrl = "" Then DEF_SiteHomeUrl = DEF_BBS_HomeUrl & "Boards.asp"
	Response.Write "<a href=""" & DEF_SiteHomeUrl & """>" & "首页</a> &gt;&gt; "
	Response.Write "<a href=""" & DEF_BBS_HomeUrl & "Boards.asp"">" & DEF_BBS_Name & "</a> &gt;&gt; <a href=""" & NewUrl & "Default.asp"">论坛管理系统</a> &gt;&gt; " & Str

End Function

Sub UserTopicTopInfo

	If GBL_TableHeadString <> "" Then
		Response.Write "<table width=" & DEF_BBS_ScreenWidth & " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>"
		Response.Write GBL_TableHeadString
		Response.Write "</td></tr></table>"
	End If
%>
	<table width="<%=DEF_BBS_ScreenWidth%>" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="<%=DEF_BBS_DarkColor%>" class=TBone>
	<tr> 
		<td width="<%=DEF_BBS_LeftTDWidth%>" bgcolor="<%=DEF_BBS_LightColor%>" class=TBBG1 valign="top"> 
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td><%If GBL_CHK_Flag=1 Then DisplayUserCenter%></td>
			</tr>
			</table>
		</td>
		<td valign="top" bgcolor=<%=DEF_BBS_LightestColor%> class=TBBG9> <br>
			<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
			<tr> 
				<td height="20"> 

<%End Sub

Sub UserTopicBottomInfo

%>
				</p></td>
			</tr>
			</table>
			<br><br></td>
	</tr>
	</table><%
	If GBL_TableBottomString <> "" Then
		%><table width=<%=DEF_BBS_ScreenWidth%> border=0 cellspacing=0 cellpadding=0 align=center><tr><td><%=GBL_TableBottomString%></td></tr></table><%
	End If

End Sub

Function ADODB_LoadFile(ByVal File)

	On Error Resume Next
	Dim objStream,FSFlag,fs,WriteFile
	FSFlag = 1
	If DEF_FSOString <> "" Then
		Set fs = Server.CreateObject(DEF_FSOString)
		If Err Then
			FSFlag = 0
			Err.Clear
			Set fs = Nothing
		End If
	Else
		FSFlag = 0
	End If
	
	If FSFlag = 1 Then
		Set WriteFile = fs.OpenTextFile(Server.MapPath(File),1,True)
		If Err Then
			GBL_CHK_TempStr = "<br>读取文件失败：" & err.description & "<br>其它可能：确定是否对此文件有读取权限."
			err.Clear
			Set Fs = Nothing
			Exit Function
		End If
		If Not WriteFile.AtEndOfStream Then
			ADODB_LoadFile = WriteFile.ReadAll
			If Err Then
				GBL_CHK_TempStr = "<br>读取文件失败：" & err.description & "<br>其它可能：确定是否对此文件有读取权限."
				err.Clear
				Set Fs = Nothing
				Exit Function
			End If
		End If
		WriteFile.Close
		Set Fs = Nothing
	Else
		Set objStream = Server.CreateObject("ADODB.Stream")
		If Err.Number=-2147221005 Then 
			GBL_CHK_TempStr = "<div align='center'>您的主机不支持ADODB.Stream，无法完成操作，请手工进行</div>"
			Err.Clear
			Set objStream = Noting
			Exit Function
		End If
		With objStream
			.Type = 2
			.Mode = 3
			.Open
			.LoadFromFile Server.MapPath(File)
			.Charset = "GB2312"
			.Position = 2
			ADODB_LoadFile = .ReadText
			.Close
		End With
		Set objStream = Nothing
	End If
	If Err Then
		GBL_CHK_TempStr = "<br>错误信息：" & err.description & "<br>其它可能：确定是否对此文件有读取权限."
		err.Clear
		Set Fs = Nothing
		Exit Function
	End If

End Function

'存储内容到文件
Sub ADODB_SaveToFile(ByVal strBody,ByVal File)

	On Error Resume Next
	Dim objStream,FSFlag,fs,WriteFile
	FSFlag = 1
	If DEF_FSOString <> "" Then
		Set fs = Server.CreateObject(DEF_FSOString)
		If Err Then
			FSFlag = 0
			Err.Clear
			Set fs = Nothing
		End If
	Else
		FSFlag = 0
	End If
	
	If FSFlag = 1 Then
		Set WriteFile = fs.CreateTextFile(Server.MapPath(File),True)
		WriteFile.Write strBody
		WriteFile.Close
		Set Fs = Nothing
	Else
		Set objStream = Server.CreateObject("ADODB.Stream")
		If Err.Number=-2147221005 Then 
			GBL_CHK_TempStr = "<div align='center'>您的主机不支持ADODB.Stream，无法完成操作，请手工进行</div>"
			Err.Clear
			Set objStream = Noting
			Exit Sub
		End If
		With objStream
			.Type = 2
			.Open
			.Charset = "GB2312"
			.Position = objStream.Size
			.WriteText = strBody
			.SaveToFile Server.MapPath(File),2
			.Close
		End With
		Set objStream = Nothing
	End If
	If Err Then
		GBL_CHK_TempStr = "<br>错误信息：" & err.description & "<br>其它可能：确定是否对此文件有写入权限."
		err.Clear
		Set Fs = Nothing
		Exit Sub
	End If

End Sub

Function CheckSupervisorPass

	If Request.Form("submitflag") = "ddddls-+++" Then
		If Mid(Cstr(Request.ServerVariables("HTTP_REFERER")),8,len(Cstr(Request.ServerVariables("SERVER_NAME")))) <> Cstr(Request.ServerVariables("SERVER_NAME")) Then
			GBL_CHK_Flag = 0
			CheckSupervisorPass = 0
			GBL_CHK_TempStr = "此操作只有管理员才能操作！<br>" & VbCrLf
			Exit Function
		End If
		Dim NumCheck
		NumCheck = CheckRndNumber
		If NumCheck = 0 Then
			GBL_CHK_Flag = 0
			CheckSupervisorPass = 0
			GBL_CHK_TempStr = "验证码错误！<br>" & VbCrLf
			Exit Function
		End If
		Session(DEF_MasterCookies & "Manager") = "manage"
	End If

	checkSupervisorPass = GBL_UserID
	If GBL_CHK_Flag = 1 and CheckSupervisorUserName = 1 and GBL_UserID > 0 Then
		GBL_CHK_Flag = 1
		checkSupervisorPass = 1
	Else
		GBL_CHK_Flag = 0
		checkSupervisorPass = 0
		GBL_CHK_TempStr = "此功能只有管理员才能操作！<br>" & VbCrLf
	End If

End Function

Function CheckRndNumber

	If DEF_EnableAttestNumber = 0 Then
		CheckRndNumber = 1
		Exit Function
	End If

	Dim RndNumber
	Dim Rs
	RndNumber = Left(Session(DEF_MasterCookies & "RndNum") & "",4)
	If RndNumber = "" or isNumeric(RndNumber) = 0 Then
		'RndNumber = 0
		Randomize
		RndNumber = Fix(Rnd*9999)+1
		Session(DEF_MasterCookies & "RndNum") = RndNumber
	End If
	RndNumber = cCur(RndNumber)
	If RndNumber = 0 Then
		RndNumber = 9999999
	End If
	
	Dim ForumNumber
	ForumNumber = Left(Request.Form("ForumNumber"),4)
	If isNumeric(ForumNumber) = False Then ForumNumber = 0
	ForumNumber = Fix(cCur(ForumNumber))
	If RndNumber = ForumNumber and RndNumber > 0 Then
		CheckRndNumber = 1
	Else
		CheckRndNumber = 0
	End If
	Randomize
	Session(DEF_MasterCookies & "RndNum") = Fix(Rnd*9999)+1

End Function%>