<% Option Explicit %> <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Mailing List '** http://www.webwizmailinglist.com '** '** Copyright ©2002-2006 Web Wiz. All Rights Reserved. '** '** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'. '** '** IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE '** THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE '** AND DERIVATIVE WORKS IMMEDIATELY. '** '** If you have not received a copy of the license with this work then a copy of the latest '** license contract can be found at:- '** '** http://www.webwizguide.com/license '** '** For more information about this software and for licensing information please contact '** 'Web Wiz' at the address and website below:- '** '** Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England '** http://www.webwizguide.com '** '** Removal or modification of this copyright notice will violate the license contract. '** '**************************************************************************************** 'Set the response buffer to true as we maybe redirecting Response.Buffer = True 'Declare variables Dim strUserName 'Holds the users username Dim strEmail 'Holds the users email Dim strPassword 'Holds the user password Dim blnAutoLogin 'Set to true if the user wants auto login Dim blnEmailFound 'Set to false if the email is not found Dim blnPasswordOK 'Set to false if the password is incorrect Dim strUserID 'Hold the users ID Dim strSaltValue 'Holds the salt value for password blnEmailFound = true blnPasswordOK = true 'Get the users email strEmail = characterStrip(Trim(Mid(LCase(Request("email")), 1, 50))) 'See if this is a new subscriber If Request.QueryString("M") = "sub" Then 'Reset server objects Set rsCommon = Nothing adoCon.Close Set adoCon = Nothing 'Redierct to the users acc details Response.Redirect("sign_up.asp?email=" & strEmail) End If 'See if an auto login cookie is set 'Read in the users ID code strUserID = Trim(Mid(Request.Cookies("WWML")("UID"), 1, 22)) 'If a user ID is read in from the cookie then redirct to the manage centre If strUserID <> "" AND Request.Form("postBack") = false Then 'Clean up the USER ID address getting rid of unwanted characters strUserID = IDcharacterStrip(strUserID) 'Initalise the strSQL variable with an SQL statement to query the database strSQL = "SELECT " & strDbTable & "Members.Active, " & strDbTable & "Members.Email, " & strDbTable & "Members.HTMLformat " & _ "FROM " & strDbTable & "Members " & _ "WHERE " & strDbTable & "Members.ID_Code = '" & strUserID & "';" 'Query the database rsCommon.Open strSQL, adoCon 'If a record is returned redirect If NOT rsCommon.EOF Then 'Reset server objects rsCommon.Close Set rsCommon = Nothing adoCon.Close Set adoCon = Nothing 'Redierct to the users acc details Response.Redirect("management_centre.asp") End If 'Close the rs rsCommon.close End If 'If this is a post back then log the user in If Request.Form("postBack") Then 'Read in the form details strPassword = Request.Form("Password") blnAutoLogin = CBool(Request.Form("auto")) 'Get the details from the database strSQL = "SELECT " & strDbTable & "Members.Email, " & strDbTable & "Members.Password, " & strDbTable & "Members.Salt, " & strDbTable & "Members.ID_Code " & _ "FROM " & strDbTable & "Members " & _ "WHERE " & strDbTable & "Members.Email = '" & strEmail & "';" 'Query the database rsCommon.Open strSQL, adoCon 'If there is a record returned check the password If NOT rsCommon.EOF Then 'Read in the salt value strSaltValue = rsCommon("Salt") 'Encrypt the entered password If blnEncryptPasswords Then strPassword = HashEncode(strPassword & strSaltValue) 'If the password is OK then set a cookie and go to the persons acc prefernces If rsCommon("Password") = strPassword Then 'Get the user ID strUserID = rsCommon("ID_Code") 'Reset server objects rsCommon.Close Set rsCommon = Nothing adoCon.Close Set adoCon = Nothing 'Set a cookie if auto-login is selected If blnAutoLogin Then Response.Cookies("WWML")("UID") = strUserID Response.Cookies("WWML").Expires = DateAdd("yyyy", 1, Now()) 'Set temp cookie Else Response.Cookies("WWML")("UID") = strUserID End If 'Redierct to the users acc details Response.Redirect("management_centre.asp") 'Else the password is wrong Else blnPasswordOK = false End If 'Else the email is incorrect Else blnEmailFound = false End If 'Close the recordset rsCommon.Close End If 'Reset server objects Set rsCommon = Nothing adoCon.Close Set adoCon = Nothing %> Mailing List: Newsletters <% '***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** Response.Write("") '***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** %>


<% 'If there is a problem tell the user If blnEmailFound = false OR blnPasswordOK = false Then %> <% End If %>
<% = strTxtEmail %>: