<%
'#################################################################################
'## Copyright (C) 2000  Michael Anderson
'## 
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or any later version.
'## 
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'## GNU General Public License for more details.
'## 
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
'## 
'## Correspondence and Questions can be sent to:
'## reinhold@bigfoot.com
'## 
'## or
'## 
'## Snitz Communications 
'## C/O: Michael Anderson
'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp" -->  
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top_short.asp" -->
<%
select case Request.QueryString("mode") 
	case "CloseTopic"
		mLev = cint(ChkUser2(Request.Form("user"), Request.Form("Pass"))) 
		if mLev > 0 then  '## is Member
			if (chkForumModerator(Request.Form("FORUM_ID"), Request.Form("user")) = "1") _
			or (mLev = 4) _
			or (chkForumModerator(Request.Form("FORUM_ID"), session("userid")) = "1") then

				'## Forum_SQL
				strSql = "Update " & strTablePrefix & "TOPICS "
				strSql = strSql & " SET " & strTablePrefix & "TOPICS.T_STATUS = 0 "
				strSql = strSql & " WHERE " & strTablePrefix & "TOPICS.TOPIC_ID = " & Request.Form("TOPIC_ID") 

				my_Conn.Execute (strSql)
%>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>Topic Locked!</b></font></p>
<%			Else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>No Permissions to Lock Topic</font><br>
<br>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript: onClick= history.go(-1)">Go Back to Re-Authenticate</a></font></p>
<%			end if %>
<%		Else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>No Permissions to Lock Topic</font><br>
<br>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript: onClick= history.go(-1)">Go Back to Re-Authenticate</a></font></p>
<%
		end if 

	case "CloseForum"

		mLev = cint(ChkUser2(Request.Form("user"), Request.Form("Pass"))) 
		if mLev > 0 then  '## is Member
			if (chkForumModerator(Request.Form("FORUM_ID"), Request.Form("user")) = "1") or (mLev = 4) or (chkForumModerator(Request.Form("FORUM_ID"), session("userid")) = "1") then

				'## Forum_SQL
				strSql = "Update " & strTablePrefix & "FORUM "
				strSql = strSql & " SET " & strTablePrefix & "FORUM.F_STATUS = 0 "
				strSql = strSql & " WHERE " & strTablePrefix & "FORUM.FORUM_ID = " & Request.Form("FORUM_ID") 

				my_Conn.Execute (strSql)
%>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>Forum Locked!</b></font></p>
<%			else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>No Permissions to Lock Forum</font><br>
<br>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript: onClick= history.go(-1)">Go Back to Re-Authenticate</a></font></p>
<%			end if %>
<%		else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>No Permissions to Lock Forum</font><br>
<br>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript: onClick= history.go(-1)">Go Back to Re-Authenticate</a></font></p>
<%
		end if 

	case "CloseCategory"

		mLev = cint(ChkUser(Request.Form("user"), Request.Form("Pass"))) 
		if mLev > 0 then  '## is Member
			if mLev = 4 then

				'## Forum_SQL
				strSql = "Update " & strTablePrefix & "CATEGORY "
				strSql = strSql & " SET " & strTablePrefix & "CATEGORY.CAT_STATUS = 0 "
				strSql = strSql & " WHERE " & strTablePrefix & "CATEGORY.CAT_ID = " & Request.Form("CAT_ID") 

				my_Conn.Execute (strSql)
%>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>Category Locked!</b></font></p>
<%			else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>No Permissions to Lock Category</font><br>
<br>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript: onClick= history.go(-1)">Go Back to Re-Authenticate</a></font></p>
<%			end if %>
<%		else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>No Permissions to Lock Category</font><br>
<br>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript: onClick= history.go(-1)">Go Back to Re-Authenticate</a></font></p>
<%
		end if 

	case "LockMember"

		mLev = cint(ChkUser(Request.Form("user"), Request.Form("Pass"))) 
		if mLev > 0 then  '## is Member
			if mLev = 4 then

				'## Forum_SQL
				strSql = "Update " & strMemberTablePrefix & "MEMBERS "
				strSql = strSql & " SET " & strMemberTablePrefix & "MEMBERS.M_STATUS = 0 "
				strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & Request.Form("MEMBER_ID") 

				my_Conn.Execute (strSql)
%>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>Member Locked!</b></font></p>
<%			else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>No Permissions to Lock a Member</font><br>
<br>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript: onClick= history.go(-1)">Go Back to Re-Authenticate</a></font></p>
<%			end if %>
<%		else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>No Permissions to Lock a Member</font><br>
<br>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript: onClick= history.go(-1)">Go Back to Re-Authenticate</a></font></p>
<%
		end if 
	case else 
%>
<P><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">Lock <% if Request.Querystring("mode") = "Topic" then Response.Write("Topic") %><% if Request.Querystring("mode") = "Forum" then Response.Write("Forum") %><% if Request.Querystring("mode") = "Category" then Response.Write("Category") %><% if Request.Querystring("mode") = "Member" then Response.Write("Member") %></font></p>

<p><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b><font color=red>NOTE:</font></b>  
<%		select case Request.QueryString("mode") %>
<%			case "Member" %>
Only Administrators can lock a Member.
<%			case "Category" %>
Only Administrators can lock a Category.
<%			case "Forum" %>
Only Moderators and Administrators can lock a Forum.
<%			case "Topic" %>
Only Moderators and Administrators can lock a Topic.
<%		end select %>
</font></p>

<form action="pop_lock.asp?mode=<% if Request.Querystring("mode") = "Topic" then Response.Write("CloseTopic") %><% if Request.Querystring("mode") = "Forum" then Response.Write("CloseForum") %><% if Request.Querystring("mode") = "Category" then Response.Write("CloseCategory") %><% if Request.Querystring("mode") = "Member" then Response.Write("LockMember") %>" method=post>
<input type=hidden name="Method_Type" value="<% if Request.Querystring("mode") = "Topic" then Response.Write("CloseTopic") %><% if Request.Querystring("mode") = "Forum" then Response.Write("CloseForum") %><% if Request.Querystring("mode") = "Category" then Response.Write("CloseCategory") %><% if Request.Querystring("mode") = "Member" then Response.Write("LockMember") %>">
<input type=hidden name="TOPIC_ID" value="<% =Request.QueryString("TOPIC_ID") %>">
<input type=hidden name="FORUM_ID" value="<% =Request.QueryString("Forum_ID") %>">
<input type=hidden name="CAT_ID" value="<% =Request.QueryString("CAT_ID") %>">
<input type=hidden name="MEMBER_ID" value="<% =Request.QueryString("MEMBER_ID") %>">

<table border="0" width="75%" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="<% =strPopUpBorderColor %>">
    <table border="0" width="100%" cellspacing="1" cellpadding="1">
<%		if strAuthType="db" then %>
      <tr>
        <td bgcolor=<% =strPopUpTableColor %> align=right nowrap><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">User Name:</font></b></td>
        <td bgcolor=<% =strPopUpTableColor %>><input type=text name="User" value="<% =Request.Cookies("User")("Name")%>" size=20></td>
      </tr>
      <tr>
        <td bgcolor=<% =strPopUpTableColor %> align=right nowrap><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">Password:</FONT></b></td>
        <td bgcolor=<% =strPopUpTableColor %>><input type=Password name="Pass" value="<% =Request.Cookies("User")("Pword")%>" size=20></td>
      </tr>
<%		else %>
<%			if strAuthType="nt" then %>
      <tr>
        <td bgcolor=<% =strPopUpTableColor %> align=right nowrap><b><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">NT Account:</font></b></td>
        <td bgcolor=<% =strPopUpTableColor %>><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><%=Session("userid")%></FONT></td>
      </tr>
<%			end if %>
<%		end if %>   			
      <tr>
        <td bgColor=<% =strPopUpTableColor %> colspan=2 align=center><Input type=Submit value="Send"></td>
      </tr>
    </table>
    </td>
  </tr>
</table>
</form>
<% end select %>
<!--#INCLUDE FILE="inc_footer_short.asp" -->