home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
207.233.110.77
/
207.233.110.77.tar
/
207.233.110.77
/
vbasic
/
ChangePassword.asp
< prev
next >
Wrap
Text File
|
2001-10-15
|
3KB
|
78 lines
<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit %>
<!-- METADATA
TYPE="TypeLib"
FILE="C:\Program Files\Common Files\System\ADO\msado21.tlb"
-->
<!--#include file="DatabaseConnect.asp"-->
<%
Dim objRS
Dim sSQL
Dim strPassword
Dim strEmail
Dim strPath
Dim Mailer
strPassword = Trim(Request.Form("password"))
strEmail = Request.QueryString("email")
strPath = Request.QueryString("path")
If strPassword = "" Then
%>
<FORM METHOD=POST NAME=ChangePassword ACTION="ChangePassword.asp?email=<%=strEmail%>&path=<%=strPath%>">
<!--Textbox and Button for ChangePassword option-->
Enter a new Password below:<BR><BR>
New Password: <INPUT TYPE=TEXT NAME="password" SIZE="40"><BR><BR>
<INPUT TYPE=SUBMIT VALUE="Activate New Password">
<INPUT TYPE="Button" VALUE="Cancel" onClick="document.location='user.asp?action=list&email=<%=strEmail%>&path=<%=strPath%>';">
</FORM>
<%
Else
sSQL = "SELECT * From Students Where email = '" & strEmail & "'"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open sSQL, objConn, adOpenDynamic, adLockOptimistic, adCmdText
'Make sure the student's account exists
If Not (objRS.EOF And objRS.BOF) Then
objRS("password") = strPassword
'Email the Student their new password information
Set Mailer = Server.CreateObject("SoftArtisans.SMTPMail")
Mailer.FromName = "Guy Campbell"
Mailer.FromAddress = "campbell_guy@hotmail.com"
Mailer.organization = "Visual Basic - Moorpark College"
Mailer.Subject = "Moorpark College -- Visual Basic Account Confirmation"
Mailer.smtplog = "C:\mysmtplog.txt"
Mailer.live = True
Mailer.RemoteHost = "sunny.moorpark.cc.ca.us"
Mailer.Priority = 3
Mailer.addrecipient objRS("name"), objRS("email")
Mailer.bodytext = "Here is your New Visual Basic Account Password. " & vbCRLF _
& vbCRLF _
& "Name: " & objRS("name") & vbCRLF _
& "Email: " & objRS("email") & vbCRLF _
& "Password: " & objRS("password") & vbCRLF & vbCRLF _
& "Important: All information is case sensitive." & vbCRLF & vbCRLF _
& "Note: If you did not explicitly change your password," & vbCRLF _
& "please let me know immediately by emailing me at the" & vbCRLF _
& "address below." & vbCRLF & vbCRLF _
& "Thank You, " & vbCRLF & vbCRLF & "Guy Campbell" & vbCRLF & "campbell_guy@hotmail.com"
Mailer.SendMail
Mailer.ClearRecipients
Set Mailer = Nothing
objRS.Update
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
Response.Write ("<B>An email has been sent to " & strEmail & "<BR>that includes your New password information.</B><BR>")
%>
<BR><INPUT TYPE="Button" ALIGN="left" VALUE="Continue" onClick="document.location='user.asp?action=list&email=<%=strEmail%>&path=<%=strPath%>';">
<%
Else
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
Response.Redirect "error.asp?error=noacct"
End If
End If
%>