<%@ Page language="c#" Inherits="Discuz.ForumPage.Admin.safecontrol" Codebehind="global_safecontrol.aspx.cs" %>
<%@ Register TagPrefix="cc1" Namespace="Discuz.Control" Assembly="Discuz.Control" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
  <head>
		<title>safecontrol</title>
			
        <script language="javascript" src="../js/common.js"></script>
        <script type="text/javascript">
	        function setstatus(obj)
	        {
	            if(obj.id == "seccodestatus_select_5")
	            {
		            document.getElementById("seccodestatus_select_2").checked = obj.checked;
		            document.getElementById("seccodestatus_select_2").disabled = obj.checked;
		        }
		        
		        if(obj.id == "seccodestatus_select_2")
		        {
		            document.getElementById("seccodestatus_select_5").checked = obj.checked;
		            document.getElementById("seccodestatus_select_5").disabled = obj.checked;
		        }
		        
		        if(obj.id == "seccodestatus_select_1")
	            {
		            document.getElementById("seccodestatus_select_9").checked = obj.checked;
		            document.getElementById("seccodestatus_select_9").disabled = obj.checked;
		            document.getElementById("seccodestatus_select_2").checked = obj.checked;
		            document.getElementById("seccodestatus_select_2").disabled = obj.checked;
		            document.getElementById("seccodestatus_select_5").checked = obj.checked;
		            document.getElementById("seccodestatus_select_5").disabled = obj.checked;
		        }
		        
		        if(obj.id == "seccodestatus_select_9")
		        {
		            document.getElementById("seccodestatus_select_1").checked = obj.checked;
		            document.getElementById("seccodestatus_select_1").disabled = obj.checked;
		            document.getElementById("seccodestatus_select_2").checked = obj.checked;
		            document.getElementById("seccodestatus_select_2").disabled = obj.checked;
		            document.getElementById("seccodestatus_select_5").checked = obj.checked;
		            document.getElementById("seccodestatus_select_5").disabled = obj.checked;
		        }
		        checkselecedpage();
	        }
        </script>
		<link href="../styles/dntmanager.css" type="text/css" rel="stylesheet">        
   	    <link href="../styles/modelpopup.css" type="text/css" rel="stylesheet">
		<script type="text/javascript" src="../js/modalpopup.js"></script>
   </head>

	<body>
	<div class="ManagerForm">
		<form id="Form1" method="post" runat="server">
		<fieldset>
		<legend style="background:url(../images/icons/icon22.jpg) no-repeat 6px 50%;">安全控制</legend>
			<table class="table1" cellspacing="0" cellpadding="4" width="100%" align="center">
				<tr>
					<td class="td1">使用验证码<br />的页面列表:</td>
					<td>
					<cc1:TextBox id="seccodestatus" runat="server" HintShowType="down" CssClass="" RequiredFieldType="暂无校验" TextMode="MultiLine" Height="90px" Rows="4" cols="30"  HintInfo="请选取相应的页面复选框, 并在相应页面模板表单中加入{_vcode}校验码子模板, 就可以增加校验码判断功能." HintTitle="提示" ></cc1:TextBox>
					</td>
						<td colspan="2">						
	                        <table id="seccodestatus_select" border="0" style="width:100%;">
	                            <tr>
		                            <td>
		                                <input id="seccodestatus_select_0" type="checkbox" name="seccodestatus_select:0" onclick="checkselecedpage()" value="register" language="javascript" />
		                                <label for="seccodestatus_select_0">新用户注册</label>
		                            </td>
		                            <td>
		                                <input id="seccodestatus_select_5" type="checkbox" name="seccodestatus_select:5" onclick="setstatus(this);" value="showforum" language="javascript" />
		                                <label for="seccodestatus_select_5">查看(已设置密码)版块</label>
		                            </td>
	                            </tr>
	                            <tr>
		                            <td>
		                                <input id="seccodestatus_select_1" type="checkbox" name="seccodestatus_select:1" onclick="setstatus(this);" value="login"  language="javascript" />
		                                <label for="seccodestatus_select_1">用户登录</label>
		                            </td>
		                            <td>
		                                <input id="seccodestatus_select_6" type="checkbox" name="seccodestatus_select:6" onclick="checkselecedpage()" value="showtopic" language="javascript" />
		                                <label for="seccodestatus_select_6">快速回复(主题页)</label>
		                            </td>
	                            </tr>
	                            <tr>
		                            <td>
		                                <input id="seccodestatus_select_2" type="checkbox" name="seccodestatus_select:2" onclick="setstatus(this);" value="posttopic"  language="javascript" />
		                                <label for="seccodestatus_select_2">发表主题</label>
		                            </td>
		                            <td>
		                                <input id="seccodestatus_select_7" type="checkbox" name="seccodestatus_select:7" onclick="checkselecedpage()" value="usercpprofile" language="javascript" />
		                                <label for="seccodestatus_select_7">修改个人资料</label>
		                            </td>
	                            </tr>
	                            <tr>
		                            <td>
		                                <input id="seccodestatus_select_3" type="checkbox" name="seccodestatus_select:3" onclick="checkselecedpage()" value="postreply"  language="javascript" />
		                                <label for="seccodestatus_select_3">发表回复</label>
		                            </td>
		                            <td>
		                                <input id="seccodestatus_select_8" type="checkbox" name="seccodestatus_select:8" onclick="checkselecedpage()" value="editpost" language="javascript" />
		                                <label for="seccodestatus_select_8">修改帖子</label>
		                            </td>
	                            </tr>
	                            <tr>
		                            <td>
		                                <input id="seccodestatus_select_4" type="checkbox" name="seccodestatus_select:4" onclick="checkselecedpage()" value="usercppostpm"  language="javascript" />
		                                <label for="seccodestatus_select_4">发送短消息</label>
		                            </td>
		                            <td>
		                                <input id="seccodestatus_select_9" type="checkbox" name="seccodestatus_select:9" onclick="setstatus(this);" value="website" language="javascript" />
		                                <label for="seccodestatus_select_9">聚合首页登陆</label>
		                            </td>
	                            </tr>
                            </table>					
					   </td>
				</tr>
				<tr>
					<td class="td2" width="20%">最大在线人数:</td>
					<td width="30%">
						<cc1:TextBox SetFocusButtonID="SaveInfo" id="maxonlines" runat="server" HintInfo="请设置合理的数值, 范围 10~65535, 建议设置为平均在线人数的 10 倍左右" HintTitle="提示" RequiredFieldType="数据校验"  CanBeNull="必填" Text="9000" MaxLength="5" SIZE="6" MinimumValue="10" MaximumValue="65535"></cc1:TextBox>	
					</td>
					<td class="td1" width="20%">发帖灌水预防:</td>
					<td width="30%">
						<cc1:TextBox SetFocusButtonID="SaveInfo" id="postinterval" runat="server" HintInfo="两次发帖间隔小于此时间, 或两次发送短消息间隔小于此时间的二倍将被禁止, 0 为不限制" HintTitle="提示"  RequiredFieldType="数据校验" CanBeNull="必填" Text="15" MaxLength="5" SIZE="6"></cc1:TextBox>(单位:秒)
					</td>
				</tr>
				<tr>
					<td class="td2">搜索时间限制:</td>
					<td>
						<cc1:TextBox SetFocusButtonID="SaveInfo" id="searchctrl" runat="server" HintInfo="两次搜索间隔小于此时间将被禁止, 0 为不限制" HintTitle="提示" RequiredFieldType="数据校验" CanBeNull="必填" Text="0" MaxLength="5" SIZE="6"></cc1:TextBox>(单位:秒)
					</td>
					<td class="td1">60 秒最大搜索次数:</td>
                    <td>
						<cc1:TextBox SetFocusButtonID="SaveInfo" id="maxspm" runat="server" HintInfo="论坛系统每 60 秒系统响应的最大搜索次数, 0 为不限制. 注意: 如果服务器负担较重, 建议设置为 5, 或在 5~20 范围内取值, 以避免过于频繁的搜索造成数据表被锁" HintTitle="提示" RequiredFieldType="数据校验"  CanBeNull="必填" Text="0" MaxLength="3" SIZE="4"></cc1:TextBox>
					</td>
				</tr>
				<tr>
					<td class="td2">用户登录时是否<br />启用安全问题:
					<td class="td2">
						<cc1:RadioButtonList ID="secques" runat="server" HintInfo="用户登录时是否启用安全问题" HintTitle="提示" RepeatLayout="flow">
							<asp:ListItem Value="1" Selected>是</asp:ListItem>
							<asp:ListItem Value="0">否</asp:ListItem>
						</cc1:RadioButtonList>
					</td>
				    </td>
				    <td  class="td1">是否使用管理<br />员客户端工具:</td>
		          <td class="td1">
		            <cc1:RadioButtonList id="admintools" runat="server" RepeatColumns="1" HintTitle="提示" HintInfo="是否使用管理员客户端工具" HintPosOffSet="180">
							    <asp:ListItem Value="0">不使用</asp:ListItem>
							    <asp:ListItem Value="1">仅论坛创始人可用</asp:ListItem>
							    <asp:ListItem Value="2">管理员可用</asp:ListItem>
						    </cc1:RadioButtonList>
			      </td>					
				</tr>	
			</table>
			</fieldset>
			<cc1:Hint id="Hint1" runat="server" HintImageUrl="../images"></cc1:Hint>
			<div class="Navbutton">
			    <cc1:Button id="SaveInfo" runat="server" Text=" 提 交 "></cc1:Button>
			</div>
        <script type="text/javascript">
        var seccodestatus='<%=ViewState["Seccodestatus"].ToString().Trim()%>';
        loadseccodestatus();
        function loadseccodestatus()
        {
	        if(seccodestatus.indexOf('register')>=0) 
	        {
		        document.getElementById("seccodestatus_select_0").checked=true;
	        }
	        if(seccodestatus.indexOf('login')>=0) 
	        {
		        document.getElementById("seccodestatus_select_1").checked=true;
	        }
	        if(seccodestatus.indexOf('posttopic')>=0) 
	        {
		        document.getElementById("seccodestatus_select_2").checked=true;
	        }
	        if(seccodestatus.indexOf('postreply')>=0) 
	        {
		        document.getElementById("seccodestatus_select_3").checked=true;
	        }
	        if(seccodestatus.indexOf('usercppostpm')>=0) 
	        {
		        document.getElementById("seccodestatus_select_4").checked =true;
	        }
	        if(seccodestatus.indexOf('showforum')>=0) 
	        {
		        document.getElementById("seccodestatus_select_5").checked=true;
	        }
	        if(seccodestatus.indexOf('showtopic')>=0) 
	        {
		        document.getElementById("seccodestatus_select_6").checked=true;
	        }
	        if(seccodestatus.indexOf('usercpprofile')>=0) 
	        {
		        document.getElementById("seccodestatus_select_7").checked=true;
	        }
	        if(seccodestatus.indexOf('editpost')>=0) 
	        {
		        document.getElementById("seccodestatus_select_8").checked=true;
	        }  
	        if(seccodestatus.indexOf('website')>=0) 
	        {
		        document.getElementById("seccodestatus_select_9").checked=true;
	        }  
        }

        function checkselecedpage()
        {
	        document.getElementById("seccodestatus").value='';
            var selectstr='';
            if(document.getElementById("seccodestatus_select_0").checked)
            {
               selectstr+='register.aspx\r\n';
            }
            if(document.getElementById("seccodestatus_select_1").checked)
            {
               selectstr+='login.aspx\r\n';
            }
            if(document.getElementById("seccodestatus_select_2").checked)
            {
               selectstr+='posttopic.aspx\r\n';
            }
            if(document.getElementById("seccodestatus_select_3").checked)
            {
               selectstr+='postreply.aspx\r\n';
            }
            if(document.getElementById("seccodestatus_select_4").checked)
            {
               selectstr+='usercppostpm.aspx\r\n';
            }
            if(document.getElementById("seccodestatus_select_5").checked)
            {
               selectstr+='showforum.aspx\r\n';
            }
            if(document.getElementById("seccodestatus_select_6").checked)
            {
               selectstr+='showtopic.aspx\r\najax.aspx\r\n';
            }
            if(document.getElementById("seccodestatus_select_7").checked)
            {
               selectstr+='usercpprofile.aspx\r\n';
            }
            if(document.getElementById("seccodestatus_select_8").checked)
            {
               selectstr+='editpost.aspx\r\n';
            }
            if(document.getElementById("seccodestatus_select_9").checked)
            {
               selectstr+='website.aspx\r\n';
            }
	        document.getElementById("seccodestatus").value=selectstr;
        }
      
        </script>
		</form>		
		</div>
		<%=footer%>
	</body>
</html>
