<!-- #include file=../../inc/BBSSetup.asp -->
<!-- #include file=../../inc/Board_Popfun.asp -->
<!-- #include file=../inc/bbsmanage_Fun.asp -->
<%
DEF_BBS_HomeUrl = "../../"
Dim GBL_ID
initDatabase
GBL_CHK_TempStr = ""
GBL_ID = checkSupervisorPass

Dim GBL_SiteDisbleWhyString,GBL_REQ_Flag

SiteHead(DEF_SiteNameString & " - 管理员")
UserTopicTopInfo
DisplayUserNavigate("网站暂停/开启")%>
<br>
<%If GBL_CHK_Flag=1 Then
	LoginAccuessFul
Else%>
	<table width=96%>
	<tr>
	<td>
	<br>
	<%
	If Request("submitflag")="" Then
		Response.Write "<br><b>请先登录</b>"
	Else
		Response.Write "<br><p align=left><font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font>"
	End If
	DisplayLoginForm
	Response.Write "</p>"%>
	</td>
	</tr>
	</table>
<%End If
UserTopicBottomInfo
closeDataBase
SiteBottom
If GBL_ShowBottomSure = 1 Then Response.Write GBL_SiteBottomString

Function LoginAccuessFul

	GBL_REQ_Flag = Request("Flag")
	If GBL_REQ_Flag <> "close" and GBL_REQ_Flag<>"open" Then GBL_REQ_Flag = "open"
	If GBL_REQ_Flag = "open" Then
		If application(DEF_MasterCookies & "SiteEnableFlagzoieiu") = 1 or application(DEF_MasterCookies & "SiteDisbleWhyszoieiu") = "" Then
			Response.Write "<br><font color=ff0000 class=RedFont><b>网站已经开启过了，不需要再开启!</b></font>" & VbCrLf
		Else
			Application.Lock
			application(DEF_MasterCookies & "SiteEnableFlagzoieiu") = 1
			Application.UnLock
			Response.Write "<br><font color=008800 class=GreenFont><b>网站成功开启!</b></font>" & VbCrLf
		End If
	Else
		If application(DEF_MasterCookies & "SiteEnableFlagzoieiu") = 0 and application(DEF_MasterCookies & "SiteDisbleWhyszoieiu") <> "" Then
			Response.Write "<br><font color=ff0000 class=RedFont><b>网站已经关闭过了，不需要再关闭!</b></font>" & VbCrLf
		Else
			If Request.Form("submitflag")="Dieos9xsl29LO_8" Then
				GBL_SiteDisbleWhyString = Request.Form("GBL_SiteDisbleWhyString")
				If Trim(GBL_SiteDisbleWhyString) <> "" Then
					Application.Lock
					application(DEF_MasterCookies & "SiteEnableFlagzoieiu") = 0
					application(DEF_MasterCookies & "SiteDisbleWhyszoieiu") = GBL_SiteDisbleWhyString
					Application.UnLock
					Response.Write "<br><font color=008800 class=GreenFont><b>网站关闭成功，下面即网站暂停访问的原因：</b></font><hr size=1>" & PrintTrueText(GBL_SiteDisbleWhyString) & "<hr size=1>" & VbCrLf
				Else
					Response.Write "<br><font color=ff0000 class=RedFont><b>暂停社员访问原因不能为空!</b></font>"
				End If
				DisplayStringForm
			Else
				GBL_SiteDisbleWhyString = DEF_Now & " 起网站暂停访问"
				DisplayStringForm
			End If
			If DEF_EnableDatabaseCache = 1 Then
				If isObject(Application(DEF_MasterCookies & "con")) = True Then
					Application.Lock
					Application(DEF_MasterCookies & "con").Close
					Set Application(DEF_MasterCookies & "con") = Nothing
					Application(DEF_MasterCookies & "con") = ""
					Application.UnLock
				End If
				GBL_ConFlag = 0
			End If
		End If
	End If

End Function

Function DisplayStringForm

%>
<p>
<form action=SiteOpenClose.asp method="post">
	要暂停访问请写出<font color=ff0000 class=RedFont>暂停社员访问的原因</font>:<p>
	<textarea class=fmtxtra name=GBL_SiteDisbleWhyString rows=8 cols=61 class=l><%If GBL_SiteDisbleWhyString <> "" Then Response.Write VbCrLf & htmlEncode(GBL_SiteDisbleWhyString)%></textarea>
	<input name=submitflag type=hidden value="Dieos9xsl29LO_8">
	<input name=Flag type=hidden value="<%=htmlencode(GBL_REQ_Flag)%>">
	<p>
	<input type=submit value="暂停" class=fmbtn> <input type=reset value="取消" class=fmbtn>
</form>
请注意，暂停网站后，请不要关闭此浏览窗口，或重新登录设置为Cookie保存（不要选择无效），<font color=red class=RedFont>否则管理员将无法重新开启网站</font>(为了保证暂停后的关键数据更新安全)。
<%

End Function

Function PrintTrueText(tempString)

	If tempString<>"" Then
		PrintTrueText=Replace(Replace(Replace(Replace(Replace(htmlEncode(tempString),VbCrLf & " ","<br>" & "&nbsp;"),VbCrLf,"<br>" & VbCrLf),"   "," &nbsp; "),"  "," &nbsp;"),chr(9)," &nbsp; &nbsp; &nbsp;")

		If Left(PrintTrueText,1) = chr(32) Then
			PrintTrueText = "&nbsp;" & Mid(PrintTrueText,2)
		End If
	Else
		PrintTrueText=""
	End If

End Function%>