<%
'#################################################################################
'## 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 "OpenTopic"
		mLev = cint(ChkUser(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 = 1 "
				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 Un-Locked!</b></font></p>
<%			else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>No Permissions to Un-Lock Topic<br>
<br>
<a href="JavaScript: onClick= history.go(-1)">Back</a></font></p>
<%			end if %>
<%		else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>No Permissions to Un-Lock Topic<br>
<br>
<a href="JavaScript: onClick= history.go(-1)">Back</a></font></p>
<%
		end if 
	case "OpenForum"
		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 = 1 "
				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 Un-Locked!</b></font></p>
<%			else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>No Permissions to Un-Lock Forum<br>
<br>
<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 Un-Lock Forum<br>
<br>
<a href="JavaScript: onClick= history.go(-1)">Go Back to Re-Authenticate</a></font></p>
<%
		end if 
	case "OpenCategory"
		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 = 1 "
				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 Un-Locked!</b></font></p>
<%			else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>No Permissions to Un-Lock Category<br>
<br>
<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 Un-Lock Category<br>
<br>
<a href="JavaScript: onClick= history.go(-1)">Go Back to Re-Authenticate</a></font></p>
<%
		end if 
	case "UnLockMember"
		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 = 1 "
				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 Un-Locked!</b></font></p>
<%			else %>
<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>"><b>No Permissions to Un-Lock a Member<br>
<br>
<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 Un-Lock a Member<br>
<br>
<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 %>">Un-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>  
<%				if Request.QueryString("mode") = "Member" then %>
Only Administrators can un-lock a Member.
<%				else %>
<%					if Request.QueryString("mode") = "Category" then %>
Only Administrators can un-lock a Category.
<%					else %>
<%						if Request.QueryString("mode") = "Forum" then %>
Only Administrators can un-lock a Forum.
<%						else %>
<%							if Request.QueryString("mode") = "Topic" then %>
Only Moderators and Administrators can un-lock a Topic.
<%							end if %>
<%						end if %>
<%					end if %>
<%				end if %>
</font></p>

<form action="pop_open.asp?mode=<% if Request.Querystring("mode") = "Topic" then Response.Write("OpenTopic") %><% if Request.Querystring("mode") = "Forum" then Response.Write("OpenForum") %><% if Request.Querystring("mode") = "Category" then Response.Write("OpenCategory") %><% if Request.Querystring("mode") = "Member" then Response.Write("UnLockMember") %>" method=Post>
<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" -->