%'****Response.Redirect("default.asp")
'**** Module: Registration
'**** Page: recallLostPasswordDD.asp
'**** Author: Stephen Takakuwa
'**** Date: July 6, 1998
'**** Description: This page to recall a lost password.
'**** It can be reached from login.asp.
'**** It contains links to default.asp
'**** recallLostPassword.asp (on FORM submit).
'**** -- changed filename to avoid caching bug - alb
'**** Revisions:
%>
<%
Dim errorString
if Request.QueryString("FormMode")="" then
Response.Redirect "default.asp"
end if
function EscSingleQuotes (temp)
EscSingleQuotes = Replace(temp,"'","''")
end function
function ConvertAngleBrackets (temp)
temp2 = Replace(temp,"<","<")
ConvertAngleBrackets=Replace(temp2,">",">")
end function
Set smarty = openDB()
email = Request.Form("EMAIL")
'**** on a FORM submit
if Request.QueryString("FormMode")="submit" then
'**** Exception handling here
'**** Check email
DIM at, dot, theDomain
at ="@"
dot="."
if inStr(email, at)=false or inStr(email,dot)=false then
errorString=errorString+"
Please check your email address and make sure it's in the form 'your.name@your.host.com\'.
"
end if
'*** If no other errors to this point, is the username in database?
if (strComp(errorString,"")=0) then
sqlstr ="SELECT USER_ID, USERNAME, PASSWORD FROM PERSONAL_INFO WHERE LOWER(EMAIL)=LOWER('"&email&"')"
Set record=smarty.Execute(sqlstr)
if (record.EOF AND record.BOF) then
errorString=errorString+"No match found for email address "&email&"."
else
userID=record("USER_ID")
userName=record("USERNAME")
MD9password=record("PASSWORD")
'**** This unscrambles the password the personal_info table
'**** The random start character is seeded with the userID number
tempPassword=""
i=1
do while iLen(tempPassword)
start=start-Len(tempPassword)
loop
password=""
for i = Len(tempPassword)-start+2 to Len(tempPassword)
password=password+Mid(tempPassword,i,1)
next
for i = 1 to Len(tempPassword)-start+1
password=password+Mid(tempPassword,i,1)
next
'**** End of password descramble
'**** revised to pull from sys email table instead of embedding the copy in this asp file - alb
set EMrecord = smarty.Execute("SELECT SENDER,REPLY_TO,BODY,GREETING,SUBJECT FROM SYS_EMAIL WHERE EMAIL_FUNCTION='res'")
if NOT (EMrecord.EOF AND EMrecord.BOF) then
sender = EMrecord("SENDER")
replyString = EMrecord("REPLY_TO")
body = EMrecord("BODY")
body = EscSingleQuotes(body)
bodyString = EMrecord("GREETING")
bodyString = EscSingleQuotes(bodyString)
subjectString = EMrecord("SUBJECT")
'*** add goodies to the body of the email
bodyString = bodyString&chr(13)&chr(10)&" UserName: "&userName&chr(13)&chr(10)
bodyString = bodyString+" Password: "&password&chr(13)&chr(10)
bodyString = bodyString+" Registered Email Address: "&email&chr(13)&chr(10)
bodyString = bodyString&body
senderString = sender&chr(13)&chr(10)&"X-Info-Broker: "&Application("WEB_HOST_NAME")&chr(13)&chr(10)
smarty.Execute("INSERT INTO EMAIL (USER_ID, SUBJECT, FROM_LINE, TO_LINE, REPLY_TO, STATUS, BODY) VALUES ("&userID&",'"&subjectString&"','"&sender&"','"&email&"','"&replyString&"','QUEUED','"&bodyString&"')")
else
error = "Contact your administrator. The system wide email settings have not been entered."
end if
'**** forward to next page: login.asp
record.close
closeDB(smarty)
Set record = Nothing
Response.Redirect "login.asp?FormMode=loginSent"
end if
record.close
end if
end if
%>
Username/Password Recall Page
<%nav_bar_public()%>

eLine SmartConf(TM) System (v1.0)
<%
'**** if you reached here on a submit, something was wrong
if (Request.QueryString("FormMode")="submit") then
Response.Write("Oops! A few problems were found with the information you entered:
")
Response.Write("")
Response.Write("Please try re-entering you information below.
")
end if
%>
If you're already registered, enter through the login page.