<%
'#################################################################################
'## 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" -->
<%
if Request.QueryString("mode") = "DoIt" then
	Err_Msg = ""
	if (Request.Form("Name") = "") then 
		Err_Msg = Err_Msg & "<li>You must enter your UserName</li>"
	end if
	if (Request.Form("Email") = "") then 
		Err_Msg = Err_Msg & "<li>You Must give your email address</li>"
	end if
	if (EmailField(Request.Form("Email")) = 0) then 
		Err_Msg = Err_Msg & "<li>You Must enter a valid email address</li>"
	end if
	'##  Emails Password to Requestor if Authenticated Properly.  
	'##  This needs to be Edited to use your own email component
	'##  if you don't have one, try the w3Jmail component from www.dimac.net it's free!
	if lcase(strEmail) = "1" then
		if (Err_Msg = "") then
			'## Forum_SQL
			strSql = "SELECT M_NAME, M_PASSWORD, M_EMAIL "
			strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
			strSql = strSql & " WHERE M_NAME = '" & Request.Form("Name") & "' AND "
			strSql = strSql & "       M_EMAIL = '" & Request.Form("email") & "'"

			set rs = my_Conn.Execute (strSql)

			strRecipientsName = Request.Form("Name")
			strRecipients = request.form("email")			strSubject = strForumTitle & " " & "Password"
			strMessage = "You have received this mail because you (or someone else) have asked to be reminded of your Password for " & strForumTitle & " at " & strForumURL & vbCrLf & vbCrLf

			if rs.EOF or rs.BOF then
				strMessage = strMessage & "Sorry. The details you supplied were wrong or unknown." & vbCrLf & vbCrLf
				strMessage = strMessage & "Please register again at " & strForumURL & "/register.asp?mode=Register" & vbCrLf
			Else
				strMessage = strMessage & " Your Password: " & rs("M_PASSWORD") & vbCrLf
			end if
			
			strMessage = strMessage & "Thank you for using " & strForumTitle
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
			rs.close
			set rs = nothing
'			Response.Write vbCrLf & "<br>Sender: " & strSender & vbCrLf & "<br>Recipients: " & strRecipients & vbCrLf & "<br>Subject: " & strSubject & vbCrLf & "<br>Message: " & strMessage & vbCrLf & "<br>"
			Response.Write "<p><font face=" & strDefaultFontFace & " size=" & strHeaderFontSize & ">Password Reminder Sent</font></p>" & vbCrLf
			Response.Write "<p><font face=" & strDefaultFontFace & " size=" & strDefaultFontSize & ">You should receive an email soon.</font></p>" & vbCrLf
		else
%>
	<p><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">There Was A Problem With Your Email</font></p>

	<table>
	  <tr>
	    <td>
		<ul>
		<% =Err_Msg %>
		</ul>
	    </td>
	  </tr>
	</table>

	<p><font size="<% =strDefaultFontSize %>"><a href="JavaScript:history.go(-1)">Go Back To Enter Data</a></font></p>

	<p><font size="<% =strDefaultFontSize %>"><a href="JavaScript:onClick= window.close()">Close Window</A></font></p>
<%
			Response.End 
		end if
	end if
Else 
%>
<p><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">Password Reminder Request</font></p>

<form action="pop_pword.asp?mode=DoIt" method="post">
<table border="0" width="75%" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="<% =strPopUpBorderColor %>">
    <table border="0" width="100%" cellspacing="1" cellpadding="1">
    <TBODY>
      <TR>
        <TD bgColor=<% =strPopUpTableColor %> align=right nowrap><b><FONT face="<% =strDefaultFontFace %>" size=<% =strDefaultFontSize %>>User Name:</font></b></TD>
        <TD bgColor=<% =strPopUpTableColor %>><INPUT name=Name size=25></TD>
      <TR>
        <TD bgColor=<% =strPopUpTableColor %> align=right nowrap><b><FONT face="<% =strDefaultFontFace %>" size=<% =strDefaultFontSize %>>Email:</font></b></TD>
        <TD bgColor=<% =strPopUpTableColor %>><INPUT name=email size=25 value=""></TD>
      </TR>
        <TD bgColor=<% =strPopUpTableColor %> align=middle colSpan=2><INPUT name=submit1 type=submit value=Submit></TD>
      </TR>
    </TBODY>
    </TABLE>
    </td>
  </tr>
</table>
</form>
<% end if %>
<!--#INCLUDE FILE="inc_footer_short.asp" -->