<%
'#################################################################################
'## 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
'#################################################################################
%>
<% If Session("Approval") = "15916941253" Then %>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE file="inc_functions.asp" -->
<!--#INCLUDE file="inc_top.asp" -->
<table border="0" width="100%">
  <tr>
    <td width="33%" align="left" nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
    <img src="icon_folder_open.gif" height=15 width=15 border="0">&nbsp;<a href="default.asp">All Forums</a><br>
    <img src="icon_blank.gif" height=15 width=15 border="0"><img src="icon_folder_open.gif" height=15 width=15 border="0">&nbsp;<a href="admin_home.asp">Admin Section</a><br>
    <img src="icon_blank.gif" height=15 width=15 border="0"><img src="icon_blank.gif" height=15 width=15 border="0"><img src="icon_folder_open_topic.gif" height=15 width=15 border="0">&nbsp;Email Server Configuration<br>
    </font></td>
  </tr>
</table>
<%
	if Request.Form("Method_Type") = "Write_Configuration" then 
		Err_Msg = ""
		if  (Request.Form("strEmail") = "1" and strEmail = "1") or (Request.Form("strEmail") = "1" and strEmail = "0") then
			if Request.Form("strMailServer") = "" then 
				Err_Msg = Err_Msg & "<li>You Must Enter the Address of your Mail Server</li>"
			end if
			if (lcase(left(Request.Form("strHomeURL"), 7)) = "http://") or (lcase(left(Request.Form("strHomeURL"), 8)) = "https://") or Request.Form("strMailServer") = "" then
				Err_Msg = Err_Msg & "<li>Do not prefix the Mail Server Address with <b>http://</b>, <b>https://</b> or <b>file://</b></li>"
			end if
			if Request.Form("strSender") = "" then 
				Err_Msg = Err_Msg & "<li>You Must Enter the Email Address of the Forum Administrator</li>"
			end if
			if EmailField(Request.Form("strSender")) = 0 and Request.Form("strSender") <> "" then 
				Err_Msg = Err_Msg & "<li>You Must enter a valid email address for the Forum Administrator</li>"
			end if
		end if

		if Err_Msg = "" then

			my_Conn.BeginTrans

			'## Forum_SQL
			strSql = "UPDATE " & strTablePrefix & "CONFIG "
			strSql = strSql & " SET C_STREMAIL                 = '" & Request.Form("strEmail") & "'"
			strSql = strSql & ",    C_STRMAILMODE              = '" & Request.Form("strMailMode") & "'"
			if  (Request.Form("strEmail") = "1" and strEmail = "1") or (Request.Form("strEmail") = "1" and strEmail = "0") then
				strSql = strSql & ",    C_STRMAILSERVER            = '" & Request.Form("strMailServer") & "'"
				strSql = strSql & ",    C_STRSENDER                = '" & Request.Form("strSender") & "'"
			end if
			strSql = strSql & ",    C_STRUNIQUEEMAIL           = '" & Request.Form("strUniqueEmail") & "'"
		
			my_Conn.Execute(strSql)
			my_Conn.CommitTrans

%>
<p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">Configuration Posted!</font></p>
<meta http-equiv="Refresh" content="2; URL=admin_home.asp">

<p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">Congratulations!</font></p>

<p align="center"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="admin_home.asp">Back To Admin Home</font></a></p>
<%		else %>
	<p align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">There Was A Problem With Your Details</font></p>

	<table align=center border=0>
	  <tr>
	    <td><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
		<ul>
		<% =Err_Msg %>
		</ul>
	    </font></td>
	  </tr>
	</table>

	<p align=center><font face="<% =strDefaultFontFace %>" size=<% =strDefaultFontSize %>><a href="JavaScript:history.go(-1)">Go Back To Enter Data</a></font></p>
<%		end if %>
<%	else %>
<form action="admin_config_email.asp" method="post" id="Form1" name="Form1">
<input type="hidden" name="Method_Type" value="Write_Configuration">
<table border="0" cellspacing="0" cellpadding="0" align=center>
  <tr>
    <td bgcolor="<% =strPopUpBorderColor %>">
<table border="0" cellspacing="1" cellpadding="1">
  <tr valign="top">
    <td bgcolor="<% =strHeadCellColor %>" colspan="2"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>"><b>Email Server Configuration</b></font></td>
  </tr>
  <tr valign="top">
    <td bgColor="<% =strPopUpTableColor %>" align="right"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b>Email Mode:</b>&nbsp;</font></td>
    <td bgColor="<% =strPopUpTableColor %>"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
    On: <input type="radio" name="strEmail" value="1" <% if lcase(strEmail) <> "0" then Response.Write("checked") %>> 
    Off: <input type="radio" name="strEmail" value="0" <% if lcase(strEmail) = "0" then Response.Write("checked") %>>
    <select name="strMailMode">
      <option value="aspmail"<% if (lcase(strMailMode)="aspmail" or lcase(MailMode)="aspmail") then Response.Write(" selected") %>>ASPMail</option>
      <option value="aspemail"<% if (lcase(strMailMode)="aspemail" or lcase(MailMode)="aspemail") then Response.Write(" selected") %>>ASPEMail</option>
      <option value="aspqmail"<% if (lcase(strMailMode)="aspqmail" or lcase(MailMode)="aspqmail") then Response.Write(" selected") %>>ASPQMail</option>
      <option value="cdonts"<% if (lcase(strMailMode)="cdonts" or lcase(MailMode)="cdonts") then Response.Write(" selected") %>>CDONTS</option>
      <option value="geocel"<% if (lcase(strMailMode)="geocel" or lcase(MailMode)="geocel") then Response.Write(" selected") %>>GeoCel</option>
      <option value="iismail"<% if (lcase(strMailMode)="iismail" or lcase(MailMode)="iismail") then Response.Write(" selected") %>>IISMail</option>
      <option value="jmail"<% if (lcase(strMailMode)="jmail" or lcase(MailMode)="jmail") then Response.Write(" selected") %>>JMail</option>
      <option value="smtp"<% if (lcase(strMailMode)="smtp" or lcase(MailMode)="smtp") then Response.Write(" selected") %>>SMTP</option>
    </select>
    <a href="JavaScript:openWindow3('pop_config_help.asp#email')"><img src="icon_smile_question.gif" border="0"></a>
    </font></td>
  </tr>
  <tr valign="top">
    <td bgColor="<% =strPopUpTableColor %>" align="right"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b>Email Server Address:</b>&nbsp;</font></td>
    <td bgColor="<% =strPopUpTableColor %>">
    <input type="text" name="strMailServer" size="25" value="<% =strMailServer %>">
    <a href="JavaScript:openWindow3('pop_config_help.asp#mailserver')"><img src="icon_smile_question.gif" border="0"></a>
    </td>
  </tr>
  <tr valign="top">
    <td bgColor="<% =strPopUpTableColor %>" align="right"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b>Administrator Email Address:</b>&nbsp;</font></td>
    <td bgColor="<% =strPopUpTableColor %>">
    <input type="text" name="strSender" size="25" value="<% =strSender %>">
    <a href="JavaScript:openWindow3('pop_config_help.asp#sender')"><img src="icon_smile_question.gif" border="0"></a>
    </td>
  </tr>
  <tr valign="top">
    <td bgColor="<% =strPopUpTableColor %>" align="right"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b>Require Unique Email:</b>&nbsp;</font></td>
    <td bgColor="<% =strPopUpTableColor %>"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
    On: <input type="radio" name="strUniqueEmail" value="1" <% if strUniqueEmail = "1" then Response.Write("checked") %>> 
    Off: <input type="radio" name="strUniqueEmail" value="0" <% if strUniqueEmail <> "1" then Response.Write("checked") %>>
    <a href="JavaScript:openWindow3('pop_config_help.asp#UniqueEmail')"><img src="icon_smile_question.gif" border="0"></a>
    </font></td>
  </tr>
  <tr valign="top">
    <td bgColor="<% =strPopUpTableColor %>" colspan="2" align="center"><input type="submit" value="Submit New Config" id="submit1" name="submit1"> <input type="reset" value="Reset Old Values" id="reset1" name="reset1"></td>
  </tr>
</table>
    </td>
  </tr>
</table></form>
</font>
<%	end if %>
<!--#INCLUDE file="inc_footer.asp" -->
<% Else %>
<% Response.Redirect "admin_login.asp" %>
<% End IF %>