📄 admin_lockuser.asp
字号:
DelDate = Dvbbs.checkstr(request.form("delTopicDate"))
suserid = Dvbbs.checkstr(request.form("SetUserID"))
Dim Canlockuser
Canlockuser = False
If (Dvbbs.Master Or Dvbbs.Boardmaster Or Dvbbs.Superboardmaster) And CInt(Dvbbs.GroupSetting(29)) = 1 Then
Canlockuser = True
Else
Canlockuser = False
End If
If Dvbbs.UserGroupID >3 And CInt(Dvbbs.GroupSetting(29))=1 Then canlockuser=True
If Dvbbs.FoundUserPer And CInt(Dvbbs.GroupSetting(29))=1 Then
Canlockuser = True
ElseIf Dvbbs.FoundUserPer And CInt(Dvbbs.GroupSetting(29))=0 Then
Canlockuser = False
End If
If Not canlockuser Then Response.redirect "showerr.asp?ErrCodes=<li>您没有权限执行此操作。&action=OtherErr"
if DelDate="" or Not IsNumeric(DelDate) Then Response.redirect "showerr.asp?ErrCodes=<li>非法的参数。&action=OtherErr"
If suserid="" or not isnumeric(suserid) then Response.redirect "showerr.asp?ErrCodes=<li>非法的参数。&action=OtherErr"
'删除帖子表中数据
'更新用户帖子数,用户删除帖子数为该帖所有回复数,回复人的删除帖子数不更新
ii = 0
REM 查询加入TOPICID排序避免有百万主题时超时 2004-5-22 Dv.Yz
If IsSqlDataBase=1 Then
Set Rs = Dvbbs.Execute("SELECT TopicID, Child, BoardID, PostTable, Dateandtime FROM [Dv_Topic] WHERE (NOT Boardid IN (444, 777)) AND PostUserID = " & Suserid & " AND DateDiff(d, DateAndTime, " & SqlNowString & ") < " & DelDate & " ORDER BY TopicID")
Else
Set Rs = Dvbbs.Execute("SELECT TopicID, Child, BoardID, PostTable, dateandtime FROM [Dv_Topic] WHERE (NOT boardid IN (444, 777)) AND PostUserID = " & Suserid & " AND DateDiff('d', DateAndTime, " & SqlNowString & ") < " & DelDate & " ORDER BY TopicID")
End If
If Not Rs.EOF Then
Sql=Rs.GetRows(-1)
Rs.Close:Set Rs = Nothing
For j = 0 To Ubound(Sql,2)
ii = ii + 1
TotalUseTable = Sql(3,j)
'更新发贴用户数据
Dvbbs.Execute("UPDATE [Dv_User] SET Userpost = Userpost - 1, UserDel = UserDel - "&Sql(1,j)&"-1 WHERE userid="&suserid)
'更新主题状态
Dvbbs.Execute("UPDATE [Dv_topic] SET locktopic = boardid, boardid = 444 WHERE topicid = "&Sql(0,j))
'更新帖子状态
Dvbbs.Execute("UPDATE "&TotalUseTable&" SET locktopic = boardid, boardid=444 WHERE rootid = "&Sql(0,j))
If DateDiff("d",Sql(4,j),Now())=0 Then
todaynum=Sql(1,j)
Else
todaynum=0
End If
'得到该帖子所属论坛的上级论坛ID
Set Trs=Dvbbs.Execute("SELECT ParentStr, ParentID FROM Dv_board WHERE boardid ="&Sql(2,j))
If Trs(1)=0 Then
UpdateBoardID=Sql(2,j)
Else
UpdateBoardID=trs(0) & "," & Sql(2,j)
End If
'更新版面数据
Dvbbs.Execute("update Dv_board set postnum=postnum-"&Sql(1,j)&"-1,topicNum=topicNum-1,todayNum=todayNum-"&todayNum&" where boardid in ("&UpdateBoardID&")")
'更新版面缓存
SplitBoardID=Split(UpdateBoardID,",")
For i=0 To Ubound(SplitBoardID)
Dvbbs.ReloadBoardCache SplitBoardID(i),-(Sql(1,j)+1),9,1
Dvbbs.ReloadBoardCache SplitBoardID(i),-1,10,1
Dvbbs.ReloadBoardCache SplitBoardID(i),-todayNum,12,1
Next
'更新总数据
Dvbbs.Execute("update dv_setup set Forum_TodayNum=Forum_todayNum-"&todaynum&",Forum_postNum=Forum_postNum-"&Sql(1,j)&"-1,Forum_TopicNum=Forum_topicNum-1")
'更新总设置缓存
Dvbbs.ReloadSetupCache CLng(Dvbbs.CacheData(7,0))-1,7
Dvbbs.ReloadSetupCache CLng(Dvbbs.CacheData(8,0))-Sql(1,j)-1,8
Dvbbs.ReloadSetupCache CLng(Dvbbs.CacheData(9,0))-todaynum,9
'更新最后回复数据
LastCount Sql(2,j),Sql(0,j),0,1
Next
End If
Set Rs = Nothing
set Trs = Nothing
Sql = "INSERT INTO Dv_Log (l_touser,l_username,l_content,l_ip,l_type) values ('"&username&"','"&Dvbbs.membername&"','用户操作:删除该用户主题 "&ii&" 条。','"&ip&"',6)"
Dvbbs.Execute(SQL)
Dvbbs.Dvbbs_suc("<li>删除该用户主题 "&ii&" 条。<li>该用户删除帖子数为所删帖所有回复数,回复人的删除帖子数不更新")
End Sub
'删除某用户指定日期内所有回复贴
Sub DelUserReply()
Dim DelDate,suserid,DelBBS
Dim todaynum
Dim trs,ii,SplitBoardID
Dim j
DelDate=Dvbbs.checkstr(request.form("delTopicDate"))
suserid=Dvbbs.checkstr(request.form("SetUserID"))
DelBBS=Left(Replace(request.form("DelBBS"),"'",""),8)
Dim canlockuser
canlockuser=false
if (Dvbbs.master or Dvbbs.boardmaster or dvbbs.superboardmaster) and Cint(Dvbbs.GroupSetting(29))=1 Then
canlockuser=True
Else
canlockuser=False
End If
If Dvbbs.UserGroupID >3 And Cint(Dvbbs.GroupSetting(29))=1 Then canlockuser=True
If Dvbbs.FoundUserPer and Cint(Dvbbs.GroupSetting(29))=1 Then
canlockuser=True
ElseIf Dvbbs.FoundUserPer and Cint(Dvbbs.GroupSetting(29))=0 then
canlockuser=False
End If
If Not canlockuser Then Response.redirect "showerr.asp?ErrCodes=<li>您没有权限执行此操作。&action=OtherErr"
If DelDate="" or not isnumeric(DelDate) Then Response.redirect "showerr.asp?ErrCodes=<li>非法的参数。&action=OtherErr"
If suserid="" or not isnumeric(suserid) Then Response.redirect "showerr.asp?ErrCodes=<li>非法的参数。&action=OtherErr"
'删除帖子表中数据
ii=0
If IsSqlDataBase=1 then
Set Rs=Dvbbs.Execute("SELECT Announceid, rootid, boardid, dateandtime FROM "&DelBBS&" WHERE (NOT boardid IN (444, 777)) AND PostUserID = "&suserid&"AND NOT ParentID = 0 AND Datediff(d, Dateandtime, "&SqlNowString&") < "&DelDate)
Else
Set Rs=Dvbbs.Execute("SELECT Announceid, rootid, boardid, dateandtime FROM "&DelBBS&" WHERE (NOT boardid IN (444, 777)) AND PostUserID = "&suserid&" AND NOT ParentID = 0 AND Datediff('d', Dateandtime, "&SqlNowString&") < "&DelDate)
End if
If Not Rs.EOF Then
Sql=Rs.GetRows(-1)
Rs.Close:Set Rs=Nothing
For j=0 To Ubound(Sql,2)
ii=ii+1
'更新发贴用户数据
Dvbbs.Execute("UPDATE [dv_user] SET userpost = userpost - 1, UserDel = UserDel - 1, UserWealth = UserWealth - "&Dvbbs.Forum_user(3)&", userEP = userEP - "&Dvbbs.Forum_user(8)&", userCP = userCP - "&Dvbbs.Forum_user(13)&" WHERE userid = "&suserid)
Dvbbs.Execute("UPDATE "&DelBBS&" SET locktopic = boardid, boardid = 444 WHERE Announceid = "&Sql(0,j))
isEndReply Sql(1,j),Sql(0,j),1
If DateDiff("d",Sql(3,j),Now())=0 Then
todaynum=1
Else
todaynum=0
End If
'得到该帖子所属论坛的上级论坛ID
Set trs=Dvbbs.Execute("SELECT ParentStr, ParentID FROM dv_board WHERE boardid = "&Sql(2,j))
If trs(1)=0 Then
UpdateBoardID=Sql(2,j)
Else
UpdateBoardID=trs(0) & "," & Sql(2,j)
End If
'更新版面数据
Dvbbs.Execute("UPDATE dv_board SET postnum = postnum - 1, todayNum = todayNum - "&todayNum&" WHERE boardid IN ("&UpdateBoardID&")")
'更新版面缓存
SplitBoardID=Split(UpdateBoardID,",")
For i=0 To Ubound(SplitBoardID)
Dvbbs.ReloadBoardCache SplitBoardID(i),-1,9,1
Dvbbs.ReloadBoardCache SplitBoardID(i),-todayNum,12,1
Next
'更新总数据
Dvbbs.Execute("UPDATE dv_setup SET Forum_TodayNum = Forum_todayNum - "&todaynum&", Forum_postNum = Forum_postNum - 1")
'更新总设置缓存
Dvbbs.ReloadSetupCache CLng(Dvbbs.CacheData(8,0))-1,8
Dvbbs.ReloadSetupCache CLng(Dvbbs.CacheData(9,0))-todaynum,9
'更新最后回复数据
LastCount Sql(2,j),Sql(1,j),Sql(0,j),2
Next
End if
Set Rs=Nothing
Set Trs=Nothing
Sql="insert into Dv_log (l_touser,l_username,l_content,l_ip,l_type) values ('"&username&"','"&Dvbbs.membername&"','用户操作:删除该用户回复 "&ii&" 条。','"&ip&"',6)"
Dvbbs.Execute(SQL)
Dvbbs.Dvbbs_suc("<li>删除该用户回复 "&ii&" 条。")
End Sub
Sub boardlist()
Dim trs
Dim dispboard
If Not AdminUserPer Then
Response.redirect "showerr.asp?ErrCodes=<li>您没有权限执行此操作。&action=OtherErr"
Else
dispboard=True
End If
If Not IsNumeric (request("userid")) then Response.redirect "showerr.asp?ErrCodes=<li>错误的用户参数。&action=OtherErr"
Response.Write "<table style=""width:70%"" cellspacing=1 cellpadding=3 align=center class=tableborder1>"
Response.Write "<tr><th colspan=6 height=23 align=left>编辑"&request("username")&"论坛权限(红色表示该用户在该版面有自定义权限)</th></tr>"
Response.Write "<tr><td colspan=6 class=tablebody1 height=25><a href=?action=userBoardPermission&boardid=0&userid="&request("userid")&">编辑该用户在其它页面的权限</a>(主要针对短信部分设置)</td></tr>"
'----------------------boardinfo--------------------
Response.Write "<tr><td colspan=6 class=tablebody1><B>点击论坛名称进入编辑状态</B><BR>"
Dim reBoard_Setting,FBoardMaster
FBoardMaster=False
sql="select * from dv_board order by rootid,orders"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
Do while Not rs.eof
reBoard_Setting=split(rs("Board_Setting"),",")
if rs("parentID")>0 and rs("depth")>0 then
set trs=Dvbbs.Execute("select boardmaster from dv_board where boardid in ("&rs("ParentStr")&") order by orders")
Do While Not trs.EOF
If Cint(reBoard_Setting(40))=1 and not FBoardMaster Then
If InStr("|"&trs(0)&"|","|"&Dvbbs.membername&"|")>0 Then
FBoardMaster=True
Else
FBoardMaster=False
End If
End If
i=i+1
If FBoardMaster Then Exit Do
if i>9 Then Exit Do
trs.MoveNext
Loop
End If
If Dvbbs.boardmaster And InStr("|"&rs("BoardMaster")&"|","|"&Dvbbs.membername&"|")=0 then dispboard=False
If FBoardMaster Then dispboard=True
If Dvbbs.master or Dvbbs.superboardmaster Then dispboard=True
if dispboard Then
If Rs("depth")>0 Then
for i=1 to rs("depth")
Response.Write " "
Next
End If
If rs("child")>0 Then
Response.Write "<img src=""skins/default/plus.gif"">"
Else
Response.Write "<img src=""skins/default/nofollow.gif"">"
End If
%>
<a href="?action=userBoardPermission&boardid=<%=rs("boardid")%>&userid=<%=request("userid")%>&name=<%=request("name")%>">
<%
set trs=Dvbbs.Execute("select uc_userid from dv_UserAccess where uc_Boardid="&rs("boardid")&" and uc_userid="&request("userid"))
if not (trs.eof and trs.bof) then Response.Write "<font color=red>"
if rs("parentid")=0 then Response.Write "<b>"
Response.Write rs("boardtype")
if rs("parentid")=0 then Response.Write "</b>"
if rs("child")>0 then Response.Write "("&rs("child")&")"
end if
Response.Write "</font></a><br>"
FBoardMaster=false
dispboard=false
rs.MoveNext
loop
set trs=nothing
set rs=nothing
Response.Write "</td></tr></table>"
End Sub
Sub GetUserPermission()
If Not AdminUserPer Then Response.redirect "showerr.asp?ErrCodes=<li>您没有权限执行此操作。&action=OtherErr"
Dim usertitle
If Not IsNumeric(request("userid")) then Response.redirect "showerr.asp?ErrCodes=<li>错误的用户参数。&action=OtherErr"
If Not IsNumeric(request("boardid")) then Response.redirect "showerr.asp?ErrCodes=<li>错误的用户参数。&action=OtherErr"
Dim UserGroupID,membername,boardtype
Response.Write "<table class=tableborder1 cellspacing=1 cellpadding=3 align=center>"
set rs=Dvbbs.Execute("select u.UserGroupID,ug.title,u.username from [dv_user] u inner join dv_UserGroups UG on u.userGroupID=ug.userGroupID where u.userid="&request("userid"))
UserGroupID=rs(0)
usertitle=rs(1)
membername=rs(2)
set rs=Dvbbs.Execute("select boardtype from dv_board where boardid="&request("boardid"))
if rs.eof and rs.bof then
boardtype="论坛其他页面"
else
boardtype=rs(0)
end if
Response.Write "<tr><th colspan=6 height=23 align=left>编辑 "&membername&" 在 "&boardtype&" 权限</th></tr>"
Response.Write "<tr><td colspan=6 height=25 class=tablebody1>注意:该用户属于 <B>"&usertitle&"</B> 用户组中,如果您设置了他的自定义权限,则该用户权限将以自定义权限为主</td></tr>"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -