<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Function RandomChar dim intRdm do intRdm = Int((122 - 49) * Rnd + 48) loop while intRdm > 57 And intRdm < 65 Or intRdm > 90 And intRdm < 97 RandomChar = chr(intRdm) End Function function RandomString (length) dim str, count str = "" count = 0 Do Until Count = length Count = Count + 1 str = str & RandomChar() Loop RandomString = str end function Sub SendEmail (xfrom,xto,xsubject,xtext) Set myMail=CreateObject("CDO.Message") set cdoConfig = CreateObject("CDO.Configuration") cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com" cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "relay-hosting.secureserver.net" cdoConfig.Fields ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 cdoConfig.Fields ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False cdoConfig.Fields ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30 'cdoConfig.Fields ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication 'cdoConfig.Fields ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="web@prozakandtheplatypus.com" 'cdoConfig.Fields ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="web4platy" cdoConfig.Fields.Update myMail.Configuration = cdoConfig myMail.Subject=xsubject myMail.From=xfrom myMail.To=xto myMail.TextBody=xtext myMail.Send set myMail=nothing set cdoConfig=nothing end sub ' Initialize some stuff dim LogonRecord, ErrorMessage, Done Randomize Timer ErrorMessage = "" Done = false ' See if we're processing a form or if we're just here the firs time... if request.form("Function") = "Login" then ' Logging in. Look for a record in the members table with the specified ' username and (encoded) password. Dim encodedpw encodedpw = PWHash(request.form("Password")) Set LogonRecord = Server.CreateObject ("ADODB.Recordset") LogonRecord.Open "Select * from Members where MemberUsername = '" & request.form("Username") & "'" _ & " and MemberPassword = '" & encodedpw & "'", MM_PlatyDB_String if LogonRecord.eof then ErrorMessage = "Invalid Username or Password; please try again" else ' Login is good! Save info in session variables, and possibly in cookies. Session("LoginID") = LogonRecord("ID") Session("LoginPassword") = encodedpw If Request.Form("SaveCredentials") then Response.Cookies("PlatyCredentials").expires = DateAdd("m", 6, Date) Response.Cookies("PlatyCredentials")("ID") = Session("LoginID") Response.Cookies("PlatyCredentials")("Password") = Session("LoginPassword") else Response.Cookies("PlatyCredentials")("ID") = -1 Response.Cookies("PlatyCredentials")("Password") = "" Response.Cookies("PlatyCredentials").expires = DateAdd("d", -1, Date) end if ErrorMessage = "G'day, mate! You're logged in.
Please stand by." Done = True LogonRecord.close end if set LogonRecord = Nothing elseif request.form("Function") = "Reset" then ' Resetting password (or registering) Dim TheID, ThePW, msg dim TypeString Set LogonRecord = Server.CreateObject ("ADODB.Recordset") LogonRecord.Open "Select * from Members where Email = '" & request.form("email") & "'", _ MM_PlatyDB_String, 2, 3 if LogonRecord.eof then LogonRecord.AddNew LogonRecord("Email") = request.form("email") LogonRecord("Confirmed") = false LogonRecord.update end if ThePW = RandomString(15) LogonRecord.update "MemberPassword", ThePW TheID = LogonRecord("ID") msg = "Hello!" & vbcrlf & vbcrlf if LogonRecord("Confirmed") then msg = msg _ & "This is an automated message from Prozak and the Platypus." & vbcrlf & vbcrlf _ & "You (or someone posing as you) have requested that a new password" & vbcrlf _ & "be generated for access to members-only functions of our website." & vbcrlf & vbcrlf _ & "To complete your password reset, please use the following link:" else msg = msg _ & "Welcome to the Prozak and the Platypus website! You (or someone" & vbcrlf _ & "posing as you) have signed up for full member access to our site." & vbcrlf _ & "We're happy to have you aboard! To complete your sign-up, please" & vbcrlf _ & "use the following link:" end if msg = msg & vbcrlf & vbcrlf _ & " https://prozakandtheplatypus.com/myprofile.asp?x=" & TheID & "&y=" & ThePW & vbcrlf & vbcrlf _ & "If your e-mail program does not highlight the link above and let you" & vbcrlf _ & "click on it directly, simply copy the entire link and paste it into" & vbcrlf _ & "your web browswer's address box." & vbcrlf & vbcrlf if LogonRecord("Confirmed") then msg = msg _ & "Please note that any previous password you may have had for the site" & vbcrlf _ & "has now been deactivated; you must follow the link above to establish" & vbcrlf _ & "your new password." & vbcrlf & vbcrlf end if msg = msg _ & "If you have any questions, or believe someone is pretending to" & vbcrlf _ & "be you in order to access our site, please e-mail us directly (write to" & vbcrlf _ & "web@prozakandtheplatypus.com or simply reply to this e-mail)." & vbcrlf & vbcrlf _ & "Thank you!" if LogonRecord("Confirmed") then TypeString = "Old" else TypeString = "New" end if SendEmail "web@prozakandtheplatypus.com", request.form("email"), "Your ProzakAndThePlatypus.com Password", msg ' We're done. From here, redirect to a confirmation page LogonRecord.close set LogonRecord = nothing response.redirect "ResetDone.asp?email=" & server.urlencode(request.form("email")) & "&type=" & TypeString end if %> Prozak and the Platypus

 

 

<% end if %>
<% if Done then %> <% else %>
<% if ErrorMessage <> "" then %>
<%= ErrorMessage %><% end if %>
   
I'm a member I'm a member
LOG IN
(Enter your info and
click on Platy.)
GET A PASSWORD
(Enter your e-mail address twice
and click on Platy. You must
have access to this mailbox.)

My Username Is:

My Password Is:


My e-mail Address Is:

Yes, it really is: