%application.lock
myname=Session("myname")
myid=Session("myid")
roomname=trdb(request("room"))
call get_guests
if myid="" or myname="" or roomname="" then response.end
if myname<>guests(myid,0) or Session("mytemp")<>guests(myid,1) then response.end
set rsparam=conn.execute("select * from param")
set rs1=conn.execute("select * from room where room_name='"&roomname&"'")
if rs1.eof or rs1.bof then
call echoerr("
曾经盛极一时的『"&roomname&"』早已倒塌了!","room.asp")
response.end
end if
if myname=rs1("room_owner") or guests(myid,4)-rsparam("ldelroom")>=0 then
owner=true
onlyread=""
else
owner=false
onlyread="readonly"
end if%>
<%if request("B1")="提交" then
if owner then
room_ref=left(trim(server.HTMLEncode(trdb(request("refuse")))),50)
room_des=left(trim(server.HTMLEncode(trdb(request("room_des")))),250)
room_auto=left(trim(server.HTMLEncode(trdb(request("room_auto")))),10)
if room_auto="" or room_des="" then
call echoerr("机器人和房间描述不能为空!","roomset.asp?room="&roomname)
response.end
end if
if request("htmlyes")="true" then
room_html=true
else
room_html=false
end if
if request("ip_protect")="true" then
ip_protect=true
else
ip_protect=false
end if
conn.execute("update room set room_auto='"&room_auto&"',room_des='"&room_des&"',room_ref='"&room_ref&"',room_html="&room_html&",ip_protect="&ip_protect&",room_time='"&now()&"' where room_name='"&roomname&"'")
end if
if guests(myid,4)-rsparam("ldelroom")>=0 then
room_name=left(trdb(trim(server.HTMLEncode(request("new_name")))),10)
room_owner=left(trdb(trim(server.HTMLEncode(request("room_owner")))),10)
if request("room_keep")="true" then
room_keep=true
else
room_keep=false
end if
conn.execute("update room set room_name='"&room_name&"',room_owner='"&room_owner&"',room_keep="&room_keep&" where room_name='"&roomname&"'")
roomname=room_name
end if
set rs1=conn.execute("select * from room where room_name='"&roomname&"'")
%>