<!--
############################  智思留言本 版权声明  ##############################
#####  智思留言本系统（版本：ZSBS v2.5 构建于 2005/4/15）                   #####
#####  智思网络（ZhiSI.Net) （2004-2024）版权所有！                         #####
#####  此留言本为自由源码版，你可以自由传播和使用而不用交纳任何款项，       #####
#####  你也可以进行更改，但必须本保留版权信息！                             #####
#####  如需删除版权信息，则必须经授权，并交纳版权费，否则将会诉诸于法律！   #####
#####  电子邮箱：zhisi@126.com  QQ：122178250  POPO：simonda                #####
#################################################################################
#####  此版权信息不会妨碍你正常使用本留言本，我们承诺完全免费，但保留版权！ #####
#################################################################################
################ 请访问http://www.zhisi.net 查看新版本信息 ######################
-->
<!-- #include file="common.asp" -->
<!-- #include file="isadm.asp" -->
<%
	Dim zsb_auth, hasAuth2
	hasAuth2 = False
	zsb_auth = Split( Trim( session("zsb_auth") ), ",", -1, 1 )
	For Each auth In zsb_auth
		If ( auth = "account" ) Then
				hasAuth2 = True
			Exit For
		End If
	Next
	
	'对帐户管理功能，因其需要设置用户功能操作权限，所以即使没有设置此功能操作权限
	'只要他是超级用户，就允许他操作此功能
	If hasAuth2 = false and session("zsb_admtp")="normaladm" Then
		Response.Write("<script language=javascript>alert('对不起，你没有权限，请联系超级管理员！');history.back(-1);</script>")
	End If
%>
<%
	set rs=Server.CreateObject("ADODB.Recordset")
	If Trim(Request("op")) = "set" Then
		authstring = Request.Form("config")
		authstring = authstring + "," + Request.Form("news")
		authstring = authstring + "," + Request.Form("account")
		authstring = authstring + "," + Request.Form("auditing")
		authstring = authstring + "," + Request.Form("modguest")
		authstring = authstring + "," + Request.Form("repguest")
		authstring = authstring + "," + Request.Form("delguest")
		authstring = authstring + "," + Request.Form("settop")
		authstring = authstring + "," + Request.Form("clearword")
		authstring = authstring + "," + Request.Form("batchadm")
		authstring = authstring + "," + Request.Form("ipdenylist")
		authstring = authstring + "," + Request.Form("denyip")
		
		sqlstr="select * from admin where ID=" & Trim(Request("id"))
		rs.open sqlstr,conn,1,3
		if not rs.eof then
			'Response.Write( authstring )
			rs("Authorization") = authstring
		  rs.Update
		end if 
		rs.close
		'set rs=nothing
		If Trim(Session("zsb_admid")) = Trim(Request("id")) Then
			Session("zsb_auth") = authstring
		End If
	End If
%>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
	<title>管理权限设置</title>
	<link href="<%=GBCss%>/common.css" rel="stylesheet" type="text/css">
</head>

<body>
<%
  	sqlstr="select * from admin where ID=" & Trim(Request("id"))
  	rs.open sqlstr, conn, 1, 1
  	If not ( rs.eof and rs.bof ) Then

		zsb_auth = Split( Trim(rs("Authorization")), ",", -1, 1 )
		
		'For Each a In zsb_auth
		  	'Response.Write( a )
		'Next

		Function hasAuth( authid )
			'If ( zsb_auth = "" ) Then
				'hasAuth = False
				'Exit Function
			'Else
				For Each auth In zsb_auth	
					'Response.Write( auth )
					If auth = authid Then
							hasAuth = True
						Exit For
						Exit Function
					Else
						hasAuth = False
					End If
				Next
			'End If
		End Function
		
%>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="20">&nbsp;</td>
  </tr>
  <tr>
    <td height="30" bgcolor="#FFFFFF" align="center" style="background-image:url(<% =GBSkin %>/guest_top.gif) " class="text_header"><b>管理员权限设置</b></td>
  </tr>
</table>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="5" bgcolor="#FFFFFF" style="background-image:url(<% =GBSkin %>/guest_bg.gif) ">
  <form name="setauth" method="POST" action="authsetting.asp?pn=<%=Trim(Request("pn"))%>&op=set&id=<%=Trim(Request("id"))%>">
  <tr>
    <td height="20">&nbsp;&nbsp;&nbsp;系统设置：
      <input id="config" name="config" type="checkbox" value="config" <% if hasAuth("config")=True then %>checked<% end if %>>
    </td>
  </tr>
  <tr>
    <td height="20">&nbsp;&nbsp;&nbsp;公告管理：
      <input id="news" name="news" type="checkbox" value="news" <% if hasAuth("news")=True then %>checked<% end if %>>
	  </td>
  </tr>
  <tr>
    <td height="20">&nbsp;&nbsp;&nbsp;帐号管理：
      <input id="account" name="account" type="checkbox" value="account" <% if hasAuth("account")=True then %>checked<% end if %>>
      </td>
  </tr>
  <tr>
    <td height="20">&nbsp;&nbsp;&nbsp;留言审核：
      <input id="auditing" name="auditing" type="checkbox" value="auditing" <% if hasAuth("auditing")=True then %>checked<% end if %>>
    </td>
  </tr>
  <tr>
    <td height="20">&nbsp;&nbsp;&nbsp;留言修改：
      <input id="modguest" name="modguest" type="checkbox" value="modguest" <% if hasAuth("modguest")=True then %>checked<% end if %>>
	</td>
  </tr>
  <tr>
    <td height="20">&nbsp;&nbsp;&nbsp;修改回复：
      <input id="repguest" name="repguest" type="checkbox" value="repguest" <% if hasAuth("repguest")=True then %>checked<% end if %>>
	</td>
  </tr>
  <tr>
    <td height="20">&nbsp;&nbsp;&nbsp;留言删除：
      <input id="delguest" name="delguest" type="checkbox" value="delguest" <% if hasAuth("delguest")=True then %>checked<% end if %>>
	</td>
  </tr>
  <tr>
    <td height="20">&nbsp;&nbsp;&nbsp;留言置顶：
      <input id="settop" name="settop" type="checkbox" value="settop" <% if hasAuth("settop")=True then %>checked<% end if %>>
	</td>
  </tr>
  <tr>
    <td height="20">&nbsp;&nbsp;&nbsp;清空留言：
      <input id="clearword" name="clearword" type="checkbox" value="clearword" <% if hasAuth("clearword")=True then %>checked<% end if %>>
	</td>
  </tr>
  <tr>
    <td height="20">&nbsp;&nbsp;&nbsp;批量管理：
      <input id="batchadm" name="batchadm" type="checkbox" value="batchadm" <% if hasAuth("batchadm")=True then %>checked<% end if %>>
	</td>
  </tr>
  <tr>
    <td height="20">&nbsp;&nbsp;&nbsp;IP阻止列表：
      <input id="ipdenylist" name="ipdenylist" type="checkbox" value="ipdenylist" <% if hasAuth("ipdenylist")=True then %>checked<% end if %>>
	</td>
  </tr>
  <tr>
    <td height="20">&nbsp;&nbsp;&nbsp;阻止IP留言：
      <input id="denyip" name="denyip" type="checkbox" value="denyip" <% if hasAuth("denyip")=True then %>checked<% end if %>>
	</td>
  </tr>
  <tr align="center">
    <td height="30">
	<input type="button" onClick="javascript:location.href='aid_mang.asp?pn=<%=Trim(Request("pn"))%>';" value="返  回" class="button_common" style="width: 80px; height:18px;">
	<input type="reset" value="重新填写" class="button_common" style="width: 80px; height:18px;">
	<input type="submit" value="保存设置" class="button_common" style="width: 80px; height:18px;"></td>
  </tr>
  </form>
</table>
<% End If%>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30" bgcolor="#FFFFFF" align="center" style="background-image:url(<% =GBSkin %>/guest_top.gif) "></td>
  </tr>
</table>
</body>
</html>