home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
bombers.k12.ar.us
/
bombers.k12.ar.us.tar
/
bombers.k12.ar.us
/
survey_unconfigured
/
ForgotPassword.asp
< prev
next >
Wrap
Text File
|
2006-10-25
|
8KB
|
212 lines
<!--#Include File="Include/Top_inc.asp"-->
<%
'***********************************************************************
' Application: SelectSurveyASP Advanced v8.1.11
' Author: Aaron Baril for ClassApps.com
' Page Description: This page contains a form that allows the user to
' enter his/her email address and receive his/her
' password by email.
'
' COPYRIGHT NOTICE
'
' See attached Software License Agreement
'
' (c) Copyright 2002 - 2006 by ClassApps.com. All rights reserved.
'***********************************************************************
%>
<!--#Include File="Include/SurveyUtility_inc.asp"-->
<!--#Include File="Include/Utility_inc.asp"-->
<!--#Include File="Include/Config_inc.asp"-->
<!--#Include File="Include/adovbs_inc.asp"-->
<!--#Include File="Include/CurrentUser_inc.asp"-->
<!--#Include File="Include/Email_inc.asp"-->
<!--#Include File="Include/SurveySecurity_inc.asp"-->
<!--#Include File="Include/Constants_inc.asp"-->
<html>
<head>
<title>Forgot Password</title>
<link rel="stylesheet" href="Resources/StyleSheet/SurveyStyle.css">
</head>
<%
Dim strMessage
Dim rsForgotPassword
Dim strEmailText
Dim strSQL
Dim flgPasswordSent
'Initialization
Set rsForgotPassword = Server.CreateObject("ADODB.Recordset")
flgPasswordSent = False
'Check to see if this page has been submitted to itself or if this is the first time on the page
If Request.Form("FormSubmitted") = SUR_BOOLEAN_POSITIVE_DISPLAY Then
'Get the count of users with this email address.
strSQL = "SELECT username, user_password " & _
"FROM sur_user " & _
"WHERE email_address = " & SQLEncode(Request.Form("txtEmailAddress"))
rsForgotPassword.Open ConvertSQL(strSQL), SURVEY_APP_CONNECTION, adOpenDynamic, , adCmdText
'If there is a user, send the email. Otherwise, display an error message.
If rsForgotPassword.EOF = False Then
rsForgotPassword.MoveFirst
strEmailText = "The login information you requested for the " & SUR_APPLICATION_NAME & " application is:" & vbCrLf & vbCrLf & _
"Username: " & rsForgotPassword("username") & vbCrLf & vbCrLf & _
"Password: " & rsForgotPassword("user_password")
SendMail Request.Form("txtEmailAddress"), SUR_APPLICATION_ADMIN_EMAIL_ADDRESS, "", "", strEmailText, "Password for " & SUR_APPLICATION_NAME, False
strMessage = "Your username and password have been sent to " & Request.Form("txtEmailAddress") & "."
flgPasswordSent = True
Else 'No records returned
strMessage = "There are no users in the system with the email address " & Request.Form("txtEmailAddress") & ". Please " & _
"enter your email address again, or click <a href=""User.asp?State=Insert"">here</a> to register."
End If
'Clean up
rsForgotPassword.Close
Set rsForgotPassword = Nothing
Else
strMessage = "Please enter your email address below. Your password will be emailed to you immediately."
End If
'The client-side JavaScript is only needed if the text box for the email address is displayed
If flgPasswordSent = False Then
%>
<script language ="JavaScript" src="ClientInclude/Utility.js"></script>
<script language="JavaScript">
function submitCheck()
{
if (trim(document.forms['frmForgotPassword'].txtEmailAddress.value) == "")
{
alert("Please enter a value for the Email Address field.");
document.forms['frmForgotPassword'].txtEmailAddress.focus();
}
else if (isValidEmailAddress(trim(document.forms['frmForgotPassword'].txtEmailAddress.value)) == false)
{
alert("The format of the email address entered is not valid. Please re-enter the email address.");
document.forms['frmForgotPassword'].txtEmailAddress.focus();
}
else
{
document.forms['frmForgotPassword'].submit();
}
}
</script>
<%
End If
%>
<body class="MainBodyStyle"
<%
'Only set the focus if the text box is being rendered
If flgPasswordSent = False Then
%>
onLoad="frmForgotPassword.txtEmailAddress.focus();"
<%
End If
%>
>
<table border="0" height="100%" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td valign="center" align="center">
<table width="450" border="0" align="center" cellpadding="0" cellspacing="0" class="DarkBlueBackgroundColor">
<tr>
<td align="left" height="36" valign="bottom">
<img border="0" alt="SelectSurveyASP Advanced" src="Resources/Images/TopLogo.gif">
</td>
</tr>
</table>
<table width="450" border="0" align="center" cellpadding="8" cellspacing="0" class="DarkBlueBackgroundColor">
<tr>
<td align="center">
<table width="434" border="0" cellpadding="7" cellspacing="0" class="MediumBlueBackgroundColor">
<tr>
<td align="center">
<table cellspacing="0" border="0" cellpadding="6" width="420" class="WhiteBackgroundColor">
<tr>
<td>
<table border="0" cellpadding="3" cellspacing="3" height="125" width="100%">
<tr>
<td colspan="2">
<span class="H2HeadingStyle">Forgot Password</span>
<br>
</td>
</tr>
<%
If flgPasswordSent = True Then
%>
<tr>
<td align="left" colspan="2" class="Normal">
<%=strMessage%><br><br><br><br>
</td>
</tr>
<tr>
<td>
</td>
<td align="right">
<a href="Login.asp?"><img border="0" alt="Login" name="btnOK" src="Resources/Buttons/OK.gif"></a>
</td>
</tr>
<%
Else
%>
<form name="frmForgotPassword" action="ForgotPassword.asp" method="post">
<input type="hidden" name="FormSubmitted" value="<%=SUR_BOOLEAN_POSITIVE_DISPLAY%>">
<tr>
<td align="left" colspan="2" class="Normal">
<%=strMessage%><br><br>
</td>
</tr>
<tr>
<td align="left" width="30%">
<span class="NormalBold"><label for="txtEmailAddress">Email Address:</label> </span>
</td>
<td align="right">
<input type="text" value="" name="txtEmailAddress" id="txtEmailAddress" maxlength="75" style="width:270px">
</td>
</tr>
<tr>
<td>
</td>
<td align="right">
<br>
<a href="Login.asp?"><img border="0" alt="Cancel" name="btnCancel" src="Resources/Buttons/Cancel.gif"></a>
<a href="javascript:submitCheck();"><img border="0" alt="Submit email address" name="btnSubmit" src="Resources/Buttons/Submit.gif"></a>
</td>
</tr>
</form>
<%
End If
%>
</form>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="450" border="0" align="center" cellpadding="0" cellspacing="0" class="DarkBlueBackgroundColor">
<tr>
<td align="center">
<!--#Include File="Include/FooterInner_inc.asp"-->
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<%
'Ensure that the web server returns the page
Response.Flush
%>