<% '************************************************************** ' Version 6.50 ' mail password to affiliate ' March 26, 2004 '************************************************************* dim my_system dim my_from dim my_fromAddress dim my_subject dim my_to dim my_toAddress Dim my_attachment Dim mailtype Dim body dim strpassword '******************************************************* ' Sends password to customer by e-mail '******************************************************* dim dbc dim UsePassword Dim Fieldname UsePassword="Yes" ' set to "Yes" for pasword instead of e-mail AdLogin ' Sub AdLogin() sAction=Request.form("Action") if saction="" then sAction=Request.form("Action.x") end if If sAction = "" Then ShopPageHeader if getconfig("xbreadcrumbs") = "Yes" then response.write "" end if Response.Write "

" & getlang("langloginforgot") & "

" GetCustomerSessionData() DisplayLoginForm() ShopPageTrailer Else ShopPageHeader if getconfig("xbreadcrumbs") = "Yes" then response.write "" end if Response.Write "

" & getlang("langloginforgot") & "

" ValidateLoginData() If Serror ="" then RetrieveLoginData end if if sError <>"" Then DisplayLoginForm else MailtoCustomer DisplayInfo end if ShopPageTrailer end if end Sub Sub DisplayLoginForm() if sError<> "" then shopwriteerror SError Serror="" end if Response.Write("
") Response.Write "
" Response.Write TableDef CreateCustRow getlang("langCustLastname"), "strLastname", strLastname,"No" CreateCustRow getlang("langCustEmail"), "strEmail", strEmail, "No" 'VP-ASP 6.50 - add a random string to email form to stop bots spamming it if getconfig("xprotectemailforms") = "Yes" then CreateCAPTCHA end if Response.Write(tabledefend) Response.Write "
" Response.Write "
" If Getconfig("xbuttoncontinue")="" Then Response.Write("") else Response.Write("") end if Response.Write "
" addwebsessform Response.Write("
") End Sub Sub ValidateLoginData() strLastname = cleanchars(Request.Form("strLastname")) strEmail = cleanchars(Request.Form("strEmail")) If strLastname = "" Then if serror="" then sError= getlang("langCommonrequired") end if sError = sError & getlang("LangLoginLastName") & "
" End If If strEmail = "" Then if serror="" then sError= getlang("langCommonrequired") end if sError = sError & getlang("LangLoginEmail") & "
" End If 'VP-ASP 6.50 - add a random string to email form to stop bots spamming it if getconfig("xprotectemailforms") = "Yes" then %><% If blnCAPTCHAcodeCorrect Then 'Fine Else sError = sError & getlang("langcaptchawrong") & "
" End If End if 'VP-ASP 6.50 - validate email address If Not InStr(strEmail, "@") > 1 Then Serror=Serror & getlang("langInvalidEmail") & "
" end if end sub Sub RetrieveLogindata Dim rs dim myconn dim templastname, tempemail templastname=replace(strlastname,"'","''") tempemail=replace(stremail,"'","''") SetSess "login", "Force" OpenAffiliateDb myconn SetSess "Login", "" sql = "select * from affiliates where lastname='" & templastname & "'" sql = sql & " and " & " email='" & tempemail & "'" Set rs = myconn.Execute(SQL) If Not rs.EOF Then strfirstname = rs("firstname") strlastname = rs("lastname") stremail = rs("email") strpassword=rs("password") if strPassword="" or isnull(strpassword) then SError = SError & getlang("Langpassword") & " " & getlang("LangErrorNoProduct") end if else SError = SError & getlang("LangLoginLocateFail") strCustomerid="" end if rs.close set rs=nothing ShopClosedatabase myconn end sub ' Sub MailToCustomer '****************************************************************** ' Mail customer the password '****************************************************************** body= getlang("LangPassword") & "= " & strPassword & chr(13) & chr(10) dim htmlformat, acount acount=0 htmlformat="Text" my_system=getconfig("xemailsystem") mailtype=Getconfig("xemailtype") my_subject= getlang("Langloginpassword") & ": " & getconfig("xemailsubject") my_from=getconfig("xemailname") my_fromAddress=getconfig("xemail") my_to=strFirstname & " " & strLastname ' this is name to email my_toAddress=stremail ' this is actual email address ExecuteMail mailtype,My_from,my_fromaddress,my_to,my_toaddress,my_subject,body,htmlformat,my_attachment,acount end sub Sub DisplayInfo shopwriteheader "" & getlang("LangForgotInfo") & "
" end sub 'VP-ASP 6.50 - add a random string to email form to stop bots spamming it Sub CreateCAPTCHA if getconfig("xprotectemailforms") <> "Yes" then exit sub Response.write tablerow & tablecolumn Response.write "*" & getlang("langcaptchaenter") & TablecolumnEnd Response.write tablecolumn getCAPTCHA Response.write tablecolumnend & tableRowend End Sub %>