📄 admin_lockuser.asp
字号:
<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<%
'=========================================================
' File: admin_lockuser.asp
' Version:5.0
' Date: 2002-10-25
' Script Written by satan
'=========================================================
' Copyright (C) 2001,2002 AspSky.Net. All rights reserved.
' Web: http://www.aspsky.net,http://www.dvbbs.net
' Email: info@aspsky.net,eway@aspsky.net
'=========================================================
dim username
dim locktype
dim ip
Dim TotalUseTable
Dim AdminUserPer
Dim UpdateBoardID
AdminUserPer=false
if (master or boardmaster or superboardmaster) and Cint(GroupSetting(42))=1 then
AdminUserPer=true
else
AdminUserPer=false
end if
if UserGroupID>3 and Cint(GroupSetting(42))=1 then
AdminUserPer=true
end if
if FoundUserPer and Cint(GroupSetting(42))=1 then
AdminUserPer=true
elseif FoundUserPer and Cint(GroupSetting(42))=0 then
AdminUserPer=false
end if
ip=Request.ServerVariables("REMOTE_ADDR")
stats="管理用户"
if request("name")="" then
Errmsg=Errmsg+"<br>"+"<li>请指定所操作的用户!"
Founderr=true
else
username=CheckStr(request("name"))
end if
call nav()
call head_var(2,0,"","")
if founderr then
call dvbbs_error()
else
if request("action")="power" then
call Poweruser()
elseif request("action")="DelTopic" then
call DelTopic()
elseif request("action")="getpermission" then
call boardlist()
elseif request("action")="userBoardPermission" then
call GetUserPermission()
elseif request("action")="saveuserpermission" then
call saveuserpermission()
elseif request("action")="DelUserReply" then
call DelUserReply()
else
call lockuser()
end if
if founderr then call dvbbs_error()
end if
call footer()
sub lockuser()
dim canlockuser
canlockuser=false
if (master or boardmaster or superboardmaster) and Cint(GroupSetting(28))=1 then
canlockuser=true
else
canlockuser=false
end if
if UserGroupID>3 and Cint(GroupSetting(28))=1 then
canlockuser=true
end if
if FoundUserPer and Cint(GroupSetting(28))=1 then
canlockuser=true
elseif FoundUserPer and Cint(GroupSetting(28))=0 then
canlockuser=false
end if
if not canlockuser then
Errmsg=Errmsg+"<br>"+"<li>您没有权限执行此操作。"
founderr=true
exit sub
end if
if request("action")="lock_1" then
conn.execute("update [user] set LockUser=1 where username='"&username&"' and UserGroupID>1")
locktype="锁定"
elseif request("action")="lock_2" then
conn.execute("update [user] set LockUser=2 where username='"&username&"' and UserGroupID>1")
locktype="屏蔽"
elseif request("action")="lock_3" then
conn.execute("update [user] set LockUser=0 where username='"&username&"' and UserGroupID>1")
locktype="解锁"
else
Errmsg=Errmsg+"<br>"+"<li>请指定正确的参数!"
Founderr=true
exit sub
end if
sucmsg="<li>您选择的用户已经"&locktype&"。"
call dvbbs_suc()
end sub
sub Poweruser()
dim title,content
dim canlockuser
canlockuser=false
if (master or boardmaster or superboardmaster) and Cint(GroupSetting(43))=1 then
canlockuser=true
else
canlockuser=false
end if
if UserGroupID>3 and Cint(GroupSetting(43))=1 then
canlockuser=true
end if
if FoundUserPer and Cint(GroupSetting(43))=1 then
canlockuser=true
elseif FoundUserPer and Cint(GroupSetting(43))=0 then
canlockuser=false
end if
if not canlockuser then
Errmsg=Errmsg+"<br>"+"<li>您没有权限执行此操作。"
founderr=true
exit sub
end if
if request("checked")="yes" then
dim doWealth,douserEP,douserCP,douserPower
dim doWealthMsg,douserEPMsg,douserCPMsg,douserPowerMsg,allMsg
if not isnumeric(request("doWealth")) or request("doWealth")="0" or request("doWealth")="" then
doWealth=0
doWealthMsg=""
else
doWealth=request("doWealth")
doWealthMsg="金钱" & request("doWealth") & ","
end if
if not isnumeric(request("douserEP")) or request("douserEP")="0" or request("douserEP")="" then
douserEP=0
douserEPMsg=""
else
douserEP=request("douserEP")
douserEPMsg="经验" & request("douserEP") & ","
end if
if not isnumeric(request("douserCP")) or request("douserCP")="0" or request("douserCP")="" then
douserCP=0
douserCPMsg=""
else
douserCP=request("douserCP")
douserCPMsg="魅力" & request("douserCP") & ","
end if
if not isnumeric(request("douserPower")) or request("douserPower")="0" or request("douserPower")="" then
douserPower=0
douserPowerMsg=""
else
douserPower=request("douserPower")
douserPowerMsg="威望" & request("douserPower")
end if
if doWealthMsg="" and douserEPMsg="" and douserCPMsg="" and douserPowerMsg="" then
allmsg="没有对用户进行分值操作"
else
allmsg="用户操作:" & doWealthMsg & douserEPMsg & douserCPMsg & douserPowerMsg
end if
'response.write allmsg
'response.end
title=request.form("title")
content=request.form("content")
content="原因:" & title & content
if request.form("title")="" and request.form("content")="" then
Errmsg=Errmsg+"<br><li>请写明操作原因。"
founderr=true
exit sub
end if
sql="insert into log (l_touser,l_username,l_content,l_ip) values ('"&username&"','"&membername&"','用户操作:"&content& ","&allmsg&"','"&ip&"')"
conn.execute(sql)
if allmsg<>"" then
conn.execute("update [user] set userWealth=userWealth+"&doWealth&",userCP=userCP+"&douserCP&",userEP=userEP+"&douserEP&",userPower=userPower+"&douserPower&" where username='"&username&"'")
end if
locktype="成功操作"
sucmsg="<li>您选择的用户已经"&locktype&"。"
call dvbbs_suc()
else
%>
<FORM METHOD=POST ACTION="admin_lockuser.asp?action=power">
<table style="width:70%" cellspacing="1" cellpadding="3" align="center" class=tableborder1>
<tr>
<th height=24>论坛管理中心--您要进行的操作是奖励用户</th>
</tr>
<tr>
<td class=tablebody1 height=24><b>
操作理由</b>:
<select name="title" size=1>
<option value="">自定义</option>
<option value="多次发表好文章">多次发表好文章</option>
<option value="对社区建设有贡献">对社区建设有贡献</option>
<option value="多次发表灌水帖子">多次发表灌水帖子</option>
<option value="多次发表广告帖子">多次发表广告帖子</option>
</select>
<input type="text" name="content" size=50> *</td>
</tr>
<tr>
<td class=tablebody1 height=24><b>
用户操作</b>: 金钱
<select name="doWealth" size=1>
<%for i=-50 to 50%>
<option value="<%=i%>" <%if cint(i)=cint(0) then%>selected<%end if%>><%=i%></option>
<%next%>
</select> 魅力
<select name="douserCP" size=1>
<%for i=-50 to 50%>
<option value="<%=i%>" <%if cint(i)=cint(0) then%>selected<%end if%>><%=i%></option>
<%next%>
</select> 经验
<select name="douserEP" size=1>
<%for i=-50 to 50%>
<option value="<%=i%>" <%if cint(i)=cint(0) then%>selected<%end if%>><%=i%></option>
<%next%>
</select> 威望
<select name="douserPower" size=1>
<%for i=-5 to 5%>
<option value="<%=i%>" <%if cint(i)=cint(0) then%>selected<%end if%>><%=i%></option>
<%next%>
</select>
*</td>
</tr>
<input type=hidden value="yes" name="checked">
<input type=hidden value="<%=username%>" name="name">
<tr>
<td class=tablebody2 height=24>
请慎重使用管理员的管理职能,管理员所有操作将被记录 <input type="submit" name=submit value="确认操作"></td>
</tr>
</table>
</FORM>
<%
end if
end sub
'删除用户1-10天内主题
sub deltopic()
Dim DelDate,suserid
Dim todaynum
Dim trs,ii
DelDate=checkstr(request.form("delTopicDate"))
suserid=checkstr(request.form("SetUserID"))
dim canlockuser
canlockuser=false
if (master or boardmaster or superboardmaster) and Cint(GroupSetting(29))=1 then
canlockuser=true
else
canlockuser=false
end if
if UserGroupID>3 and Cint(GroupSetting(29))=1 then
canlockuser=true
end if
if FoundUserPer and Cint(GroupSetting(29))=1 then
canlockuser=true
elseif FoundUserPer and Cint(GroupSetting(29))=0 then
canlockuser=false
end if
if not canlockuser then
Errmsg=Errmsg+"<br>"+"<li>您没有权限执行此操作。"
founderr=true
exit sub
end if
if DelDate="" or not isnumeric(DelDate) then
Errmsg=Errmsg+"<br>"+"<li>非法的参数。"
Founderr=true
exit sub
end if
if suserid="" or not isnumeric(suserid) then
Errmsg=Errmsg+"<br>"+"<li>非法的参数。"
Founderr=true
exit sub
end if
'删除帖子表中数据
'更新用户帖子数,用户删除帖子数为该帖所有回复数,回复人的删除帖子数不更新
ii=0
Set rs=conn.execute("select TopicID,Child,BoardID,PostTable,dateandtime from topic where PostUserID="&suserid&" and locktopic<2 and datediff('d',DateAndTime,Now())<"&DelDate&"")
do while not rs.eof
ii=ii+1
TotalUseTable=rs(3)
'更新发贴用户数据
conn.execute("update [user] set article=article-1,UserDel=UserDel-"&rs(1)&"-1 where userid="&suserid)
'更新主题状态
conn.execute("update topic set locktopic=2 where topicid="&rs(0))
'更新帖子状态
conn.execute("update "&TotalUseTable&" set locktopic=2 where rootid="&rs(0))
if datediff("d",rs(4),Now())=0 then
todaynum=rs(1)
else
todaynum=0
end if
'得到该帖子所属论坛的上级论坛ID
set trs=conn.execute("select ParentStr from board where boardid="&rs(2))
UpdateBoardID=trs(0) & "," & rs(2)
'更新版面数据
conn.execute("update board set lastbbsnum=lastbbsnum-"&rs(1)&"-1,lasttopicNum=lasttopicNum-1,todayNum=todayNum-"&todayNum&" where boardid in ("&UpdateBoardID&")")
'更新总数据
conn.execute("update config set TodayNum=todayNum-"&todaynum&",BbsNum=bbsNum-"&rs(1)&"-1,TopicNum=topicNum-1")
'更新最后回复数据
LastCount rs(2),rs(0),0,1
rs.movenext
loop
set rs=nothing
set trs=nothing
sucmsg="<li>删除该用户主题"&ii&"条。<li>该用户删除帖子数为所删帖所有回复数,回复人的删除帖子数不更新"
call dvbbs_suc()
end sub
'删除某用户指定日期内所有回复贴
sub DelUserReply()
Dim DelDate,suserid,DelBBS
Dim todaynum
Dim trs,ii
DelDate=checkstr(request.form("delTopicDate"))
suserid=checkstr(request.form("SetUserID"))
DelBBS=checkstr(request.form("DelBBS"))
dim canlockuser
canlockuser=false
if (master or boardmaster or superboardmaster) and Cint(GroupSetting(29))=1 then
canlockuser=true
else
canlockuser=false
end if
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -