%@ Language=VBScript %> <% '************************************************************************* ' DO NOT MODIFY THIS SCRIPT IF YOU WANT UPDATES TO WORK! ' Function : Retrieve a customers Password and send via email ' Product : CandyPress Store Frontend ' Version : 6.2 ' Modified : May 2007 ' Copyright: Copyright (C) 2010 Cavallo Communications, LLC. ' See "license.txt" for this product for details regarding ' licensing, usage, disclaimers, distribution and general ' copyright requirements. If you don't have a copy of this ' file, you may request one at http://www.candypress.com '************************************************************************* ' 02/07/10 : Removed tables, replaced with div - candythemes.com '************************************************************************* Option explicit Response.Buffer = true %> <% 'Customer dim status dim Name dim LastName dim Email dim Password 'Work Fields dim arrayErrors dim customerEmail dim formID dim errMsg 'Database dim mySQL dim conntemp dim rstemp dim rstemp2 Dim send 'Session dim idOrder dim idCust '************************************************************************* 'Open Database Connection call openDb() 'Store Configuration if loadConfig() = false then call errorDB(LangText("ErrConfig",""),"") end if 'Get/Set Cart/Order Session idOrder = sessionCart() 'Get/Set Customer Session idCust = sessionCust() 'Get Form ID formID = Request.Form("formID") if formID <> "00b" then formID = "" end if 'Check if user clicked the "Get Password" button if formID = "00b" then send = validHTML(Request.Form("Submit")) 'Get email from the form Email = validHTML(Request.form("Email")) 'Do some checks if len(email) = 0 or invalidChar(Email,1,"@.-_") then arrayErrors = arrayErrors & "|email" else 'Check if email exists on DB, and if Customer is still Active mySQL = "SELECT name, lastname, password " _ & "FROM " & tablePrefix & "customer " _ & "WHERE email = '" & validSQL(email,"A") & "' " _ & "AND status = 'A'" set rsTemp = openRSexecute(mySQL) if not rstemp.eof then 'Build Email Body customerEmail = "" mySQL = "SELECT configValLong " _ & "FROM " & adminTablePrefix & "storeAdmin " _ & "WHERE configVar = 'passRequestEmail_" & session("language") & "' " _ & "AND adminType = 'T'" set rsTemp2 = openRSexecute(mySQL) if not rstemp2.eof then customerEmail = trim(rsTemp2("configValLong")) end if call closeRS(rsTemp2) 'Check for tags and replace customerEmail = replace(customerEmail,"#NAME#",rsTemp("name") & " " & rsTemp("lastName")) customerEmail = replace(customerEmail,"#PASS#",EnDeCrypt(Hex2Ascii(rsTemp("password")),rc4Key)) customerEmail = replace(customerEmail,"#STORE#",pCompany) 'Send Email to Customer call sendmail (pCompany, pEmailAdmin, email, LangText("GenPassRequest",""), customerEmail, 0) else 'Invalid email entered arrayErrors = arrayErrors & "|email" end if call closeRS(rsTemp) end if 'There were no errors if len(trim(arrayErrors)) = 0 then errMsg = LangText("GenPassSentMsg","") call closeDB() Response.redirect "sysMsg.asp?msg=" & server.URLEncode(errMsg) end if end if %> <% 'Close Database Connection call closeDB() '********************************************************************** 'Main Shopping Cart Display Area '********************************************************************** sub cartMain() %>