<% Call SLProtectPage("22,44,88") %> <% ' include file="sitelock/Connections/Sitelockv3.asp" %> <% 'The following three lines of code are used to make sure that this page is not cached on the client. Response.CacheControl = "no-cache" Response.AddHeader "Pragma", "no-cache" Response.Expires = 0 %> <% ' *************************************** ' ** D2 Sitelock v3 ** ' This application, its design and its code remains the intellectual property of D2 Computing Ltd and P Durbar. ' D2 Sitelock must not be redistributed in whole or in part under any circumstance or used on any site not covered by a purchased D2 Sitelock license. ' If you suspect this installation is unlicensed, please contact support@d2computing.co.uk ' Any 3rd party code or scripts used within D2 Sitelock are commented as such and the author, where known, credited ' Removal of this commented text violates the license agreement. ' For further info on D2 Sitelock Licensing, visit http://www.d2computing.co.uk ' *************************************** ' *** Edit Operations: declare variables Dim MM_editAction Dim MM_abortEdit Dim MM_editQuery Dim MM_editCmd Dim MM_editConnection Dim MM_editTable Dim MM_editRedirectUrl Dim MM_editColumn Dim MM_recordId Dim MM_fieldsStr Dim MM_columnsStr Dim MM_fields Dim MM_columns Dim MM_typeArray Dim MM_formVal Dim MM_delim Dim MM_altVal Dim MM_emptyVal Dim MM_i MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")) If (Request.QueryString <> "") Then MM_editAction = MM_editAction & "?" & Request.QueryString End If ' boolean to abort record edit MM_abortEdit = false ' query string to execute MM_editQuery = "" %> <% ' *** Update Record: set variables If (CStr(Request("MM_update")) = "form1" And CStr(Request("MM_recordId")) <> "") Then MM_editConnection = MM_Sitelockv3_STRING MM_editTable = "SLUsers" MM_editColumn = "D2ID" MM_recordId = "" + Request.Form("MM_recordId") + "" MM_editRedirectUrl = "userprofile.asp?Update=OK" MM_fieldsStr = "txtUsername|value|txtEmail|value|txtFirstName|value|txtSurname|value|txtAddr1|value|txtAddr2|value|txtAddr3|value|txtCounty|value|txtCountry|value|txtCompany|value|chkOptOut|value|txtCustom1|value|txtCustom2|value|txtCustom3|value|txtCustom4|value|txtCustom5|value|chkcustom9|value" MM_columnsStr = "D2Username|',none,''|D2EmailAddress|',none,''|D2FirstName|',none,''|D2Surname|',none,''|D2Addr1|',none,''|D2Addr2|',none,''|D2Addr3|',none,''|D2StateCounty|',none,''|D2Country|',none,''|D2CompanyName|',none,''|D2MailOptOut|none,1,0|D2Custom1|',none,''|D2Custom2|',none,''|D2Custom3|',none,''|D2Custom4|',none,''|D2Custom5|',none,''|D2Custom9|none,1,0" ' create the MM_fields and MM_columns arrays MM_fields = Split(MM_fieldsStr, "|") MM_columns = Split(MM_columnsStr, "|") ' set the form values For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2 MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i))) Next ' append the query string to the redirect URL If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString Else MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString End If End If End If %> <% ' *** Update Record: construct a sql update statement and execute it If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then ' create the sql update statement MM_editQuery = "update " & MM_editTable & " set " For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2 MM_formVal = MM_fields(MM_i+1) MM_typeArray = Split(MM_columns(MM_i+1),",") MM_delim = MM_typeArray(0) If (MM_delim = "none") Then MM_delim = "" MM_altVal = MM_typeArray(1) If (MM_altVal = "none") Then MM_altVal = "" MM_emptyVal = MM_typeArray(2) If (MM_emptyVal = "none") Then MM_emptyVal = "" If (MM_formVal = "") Then MM_formVal = MM_emptyVal Else If (MM_altVal <> "") Then MM_formVal = MM_altVal ElseIf (MM_delim = "'") Then ' escape quotes MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'" Else MM_formVal = MM_delim + MM_formVal + MM_delim End If End If If (MM_i <> LBound(MM_fields)) Then MM_editQuery = MM_editQuery & "," End If MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal Next MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId If (Not MM_abortEdit) Then ' execute the update Set MM_editCmd = Server.CreateObject("ADODB.Command") MM_editCmd.ActiveConnection = MM_editConnection MM_editCmd.CommandText = MM_editQuery MM_editCmd.Execute MM_editCmd.ActiveConnection.Close If (MM_editRedirectUrl <> "") Then Response.Redirect(MM_editRedirectUrl) End If End If End If %> <% Dim RSLoginPage Dim RSLoginPage_numRows Set RSLoginPage = Server.CreateObject("ADODB.Recordset") RSLoginPage.ActiveConnection = MM_Sitelockv3_STRING RSLoginPage.Source = "SELECT D2Sitename, D2PathLoginPage FROM SLVars" RSLoginPage.CursorType = 0 RSLoginPage.CursorLocation = 2 RSLoginPage.LockType = 1 RSLoginPage.Open() RSLoginPage_numRows = 0 %> <% Dim GetUsersGUID ' try to get the logged in users GUID from cookie or session var If Session("SL_UserGUID") <> "" Then GetUsersGUID = Session("SL_UserGUID") Else If Request.Cookies("D2SITELOCK")("SLUserGUID") <> "" Then GetUsersGUID = Request.Cookies("D2SITELOCK")("SLUserGUID") Else GetUsersGUID = "1" End If End If Dim GetUsersName ' try to get the logged in users username from cookie or session var If Session("SL_Username") <> "" Then GetUsersName = Session("SL_Username") Else If Request.Cookies("D2SITELOCK")("SLUserNAME") <> "" Then GetUsersName = Request.Cookies("D2SITELOCK")("SLUserNAME") Else GetUsersName = "invaliduser" End If End If Dim RSUserVars__MMColParam RSUserVars__MMColParam = Trim(GetUsersGUID) Dim RSUserName__MMColParam RSUserName__MMColParam = Trim(GetUsersName) %> <% Dim RSUserVars Dim RSUserVars_numRows Set RSUserVars = Server.CreateObject("ADODB.Recordset") RSUserVars.ActiveConnection = MM_Sitelockv3_STRING RSUserVars.Source = "SELECT * FROM SLUsers WHERE D2Username = '" + Replace(RSUserName__MMColParam, "'", "''") + "' AND D2UserGUID = '" + Replace(RSUserVars__MMColParam, "'", "''") + "'" RSUserVars.CursorType = 0 RSUserVars.CursorLocation = 2 RSUserVars.LockType = 1 RSUserVars.Open() If RSUserVars.EOF And RSUserVars.BOF Then ' redirect the user to the login page if their username Response.Redirect((RSLoginPage.Fields.Item("D2PathLoginPage").Value)) End If %> <% ' check the logged in users session vars or cookies exist in the database %> <% Dim RScustomMaps Dim RScustomMaps_numRows Set RScustomMaps = Server.CreateObject("ADODB.Recordset") RScustomMaps.ActiveConnection = MM_Sitelockv3_STRING RScustomMaps.Source = "SELECT D2Custom1map, D2Custom2map, D2Custom3map, D2Custom4map, D2Custom5map, D2Custom6map, D2Custom7map, D2Custom8map, D2Custom9map, D2Custom10map FROM SLVars" RScustomMaps.CursorType = 0 RScustomMaps.CursorLocation = 2 RScustomMaps.LockType = 1 RScustomMaps.Open() RScustomMaps_numRows = 0 %> Your profile

<%=(RSLoginPage.Fields.Item("D2Sitename").Value)%> - Your Profile

<% If Request.QueryString("Update") = "OK" Then %>Your updates were completed successfully <% End If %>
Your Username: " size="50">
Please Note: changing your username may log you out of the system. If this happens, simply re-login using your new username.
Your Email Address: " size="50">
Your Display Name: " size="50">
First Name: " size="50">
Surname: " size="50">
Boat Name: " size="50">
Boat Type: " size="50">
    Send us a picture of your boat! We don't allow automatic uploads for pictures, but email one to us at picture@sea-dreamer.com.
Boat Location: " size="50">
State/County: " size="50">
Country: <% If (RSUserVars.Fields.Item("D2Country").Value) <> "None Selected" Then %>" size="50"> <% Else %> <% End If %>
<%=(RScustomMaps.Fields.Item("D2Custom1map").Value)%>
<%=(RScustomMaps.Fields.Item("D2Custom2map").Value)%>
<%=(RScustomMaps.Fields.Item("D2Custom3map").Value)%>
<%=(RScustomMaps.Fields.Item("D2Custom4map").Value)%>
<%=(RScustomMaps.Fields.Item("D2Custom5map").Value)%>*
  * All registered users will be "Dreamers" or "Reluctant Sailors". Only people who have been on the boat will be crew!
<%=(RScustomMaps.Fields.Item("D2Custom9map").Value)%> > - Checked = You are happy for others to see your profile
Mail Opt Out: ** > - Checked = You do not want mail sent to this address
  ** If this option is selected, your email address will not be included in any email newsletters or announcements sent from this site.

">

Log Out

 

 

<% RSUserVars.Close() Set RSUserVars = Nothing %> <% RSLoginPage.Close() Set RSLoginPage = Nothing %>