<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<!--#include file="forbbs.asp"-->
<%
Call head()
call saycardd("版主管理")
dim ation,ID,liyou,locktian

ation    = request("ation")
ID       = request("ID")
locktian = request("locktian")
liyou = forbbs(request("liyou"))

if ID="" or ation="" then
  Call Error("错误的指令或者未输入操作原因！")
  end if


if IsNumeric(ID)=False then
  Call Error("ID无效！")
  end if

set rs=server.createobject("adodb.recordset")
rs.open "select keys,skey from Users where ID="&ID,conn,1,1
if rs.eof then
  Call Error("没有这个会员！")
end if

rs.close
set rs=nothing
if ation = "nof" or ation = "f" or ation = "noh" or ation = "h" or ation = "nox" or ation= "x" or ation = "nol" or ation= "l" or ation= "noj"  or ation= "j" or ation= "nolock"  or ation= "lock" then
else
  Call Error("操作无效！")
  end if



if locktian<>"" then
  locktian=clng(locktian)
  if locktian > 15 then
  Call Error("期限选择错误！")
  end if
end if

if len(ation) =3 then

if liyou="" or len(liyou) < 2 then
  Call Error("操作原因不充分！")
  end if

if len(liyou) > 30 then
  Call Error("操作原因不能超过30字！")
  end if
end if

dim guliname
set rs=server.createobject("adodb.recordset")
rs.open "select * from Users where ID="&ID,conn,1,2

if rs.eof then
  Call Error("用户不存在！")
  end if
guliname = rs("name")



if ation="lock" then
rs("hmd")=1
elseif ation="nolock" then
rs("hmd")=0
end if


 if locktian=0 then
 rs("gulitime")=now()+0.042
 else
 rs("gulitime")=now()+locktian
 end if
'elseif len(ation)=3 then
'rs("strCat")=replace(rs("strCat"),right(ation,1),"")
'end if

rs.update
rs.close
set rs=Nothing

dim adminsell,adminrel,adminmsg,adminall,adminchat,adminlock,fl
'------------------
if ation="nof"  then
adminsell=1
adminrel=0
adminmsg=0
adminall=0
adminchat=0
fl=1
end if

if ation= "f"  then
adminsell=0
fl=0
end if

if ation="noh"  then
adminrel=1
adminsell=0
adminmsg=0
adminall=0
adminchat=0
fl=1
end if

if ation= "h"  then
adminrel=0
fl=0
end if

if ation="nox"  then
adminmsg=1
adminsell=0
adminrel=0
adminall=0
adminchat=0
fl=1
end if

if ation= "x"  then
adminmsg=0
fl=0
end if

if ation="nol"  then
adminchat=1
adminsell=0
admirel=0
adminmsg=0
adminall=0
fl=1
end if

if ation= "l"  then
adminchat=0
fl=0
end if


if ation="noj"  then
adminall=1
adminsell=0
admirel=0
adminmsg=0
adminchat=0
fl=1
end if

if ation= "j"  then
adminall=0
fl=0
end if

if ation="lock" then
adminall=0
adminsell=0
admirel=0
adminmsg=0
adminchat=0
fl=2
end if
if ation="nolock" then
adminall=0
adminsell=0
admirel=0
adminmsg=0
adminchat=0
fl=0
end if
'-------------------------
'记录和释放黑名单
conn.execute("update Users set strbbs="&fl&" where ID="&ID)

'记录操作记录
set rs=server.createobject("adodb.recordset")
rs.open "select bbsid,adminid,adminname,strsell,strrel,strmsg,strall,strChat,guliid,guliname,gulitime,liyou,fl,locktian from hmd where guliid="&ID,conn,1,2
if rs.eof then
rs.addnew
end if
'社区管理员和版主管理权限分级

rs("bbsid")=0      '全区加黑

rs("fl")=fl  '是否黑名单

rs("strsell")=adminsell   '发贴
rs("strrel")=adminrel     '回复
rs("strall")=adminall   '加黑
rs("strmsg")=adminmsg     '信箱
rs("strChat")=adminchat     '聊天
rs("adminid")=1
rs("adminname")="管理员"
rs("guliid")=ID
rs("guliname")=guliname
rs("gulitime")=now()
if locktian<>"" then rs("locktian")=locktian
if liyou<>"" then rs("liyou")=liyou
rs.update
rs.close
set rs=Nothing
conn.close
set conn=Nothing

Response.write "操作成功！" & chr(13)
Response.write "<br/>您的操作已经记录。" & chr(13)
Response.write "<br/><a href=""adminuser.asp?ID="&ID&"&amp;sid="&sid&"&amp;saytk="&saytk&""">继续用户管理</a>" & chr(13)%>
<!--#include file="fanhui.asp"-->
<%response.write""
call headsay()%>
