Announcement

Collapse
No announcement yet.

Sellerdeck Desktop – Upgrading to reCAPTCHA v2

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Sellerdeck Desktop – Upgrading to reCAPTCHA v2

    At the end of March 2018, Google terminate the reCAPTCHA v1 service which is used for the Contact Us page in Sellerdeck Desktop sites, up to and including all versions of Sellerdeck 2016.

    To upgrade your embedded reCAPTCHA integration to reCAPTCHA v2, you must take the following steps:

    1. First, register for your own reCAPTCHA keys at https://www.google.com/recaptcha/admin#list (v2 keys are domain-specific). You must log into your Google account, or create an account if you don’t have one:

    a. Under Label, enter your site name or the same by which you want to identify it
    b. Select ‘reCAPTCHA V2’
    c. Enter your site domain (excluding the http:// or https:// and the www)
    d. Tick to accept the terms and conditions, and click ‘Register’
    e. You will see the following information displayed:


    f. Keep the page open in your browser, or copy and paste the two keys into a text file.


    2. Next, upgrade your Sellerdeck Desktop site(s) to reCAPTCHA v2:
    a. Download and extract the zip file that matches your Sellerdeck Desktop version:

    Version 12
    Version 14
    Version 16

    b. Import the design snapshot included in the zip ('File | Snapshot | Import Design'), which will update the relevant variables and layouts in your library to support the new version
    c. From the Sellerdeck ‘Settings’ menu, select ‘Site Options’ and click the ‘Properties’ tab
    d. Scroll down to the reCAPTCHA group




    e. Copy and paste your new Secret key into the ‘ReCAPTCHAPrivateKey’ field
    f. Copy and paste your new Site key into the ‘ReCAPTCHAPublicKey’ field
    g. Click ‘OK’
    h. If your MailForm.pl script file is unmodified from the Sellerdeck original, you can save the version from the relevant zip file to your site folder
    i. If your MailForm.pl script file has been modified from the original, then follow the instructions in Step 3 (below)
    j. Upload
    k. Repeat the steps b to j for each site you own. If you have sites in different versions of Sellerdeck Desktop, make sure you use the correct content for each version.


    3. If your MailForm.pl script file has been modified from the original:
    a. Navigate to your site folder, find MailForm.pl and open it in Notepad++ or a similar safe text editor. (Do not use Windows Notepad, as it may modify the file in ways that break the script functionality)
    b. Apply the following changes:


    Find the lines:

    Code:
     my $sRCChallenge = $::g_InputHash{'recaptcha_challenge_field'};
    my $sRCResponse = $::g_InputHash{'recaptcha_response_field'};
    if ($sRCResponse eq '' || # no response from user
    $sRCChallenge eq '') # challenge has been hacked
    {
    $sError = ACTINIC::GetPhrase(-1, 2753); # no need to make a server call
    }
    else
    {
    my @arrResponse =
    CheckRecaptcha($sRCChallenge, $sRCResponse); # check the response
    if ($arrResponse[0] == $::FAILURE) # if it failed
    {
    $sError = $arrResponse[1]; # save reason
    }
    }
    and replace them with:

    Code:
     my $sRCResponse = $::g_InputHash{'g-recaptcha-response'};
    if ($sRCResponse eq '') # no response from user
    {
    $sError = ACTINIC::GetPhrase(-1, 2753); # no need to make a server call
    }
    #else
    # {
    # my @arrResponse =
    # CheckRecaptcha($sRCResponse); # check the response
    # if ($arrResponse[0] == $::FAILURE) # if it failed
    # {
    # $sError = $arrResponse[1]; # save reason
    # }
    # }
    Then find the section 'sub CheckRecaptcha'.

    Replace

    Code:
    my ($sChallenge, $sResponse) = @_;
    with

    Code:
    my ($sResponse) = @_;
    and change

    Code:
     my $sContent =
    sprintf("privatekey=%s&remoteip=%s&challenge=%s&response=%s",
    $::g_sRecaptchaPrivateKey, $sRemoteIP, $sChallenge, $sResponse);
    to

    Code:
     my $sContent = sprintf
    ("privatekey=%s&remoteip=%s&response=%s",$::g_sRecaptchaPrivateKey, $sRemoteIP, $sResponse);
    Attached Files
    Last edited by G.W.Green; 04-Jun-2018, 10:45 AM.

    #2
    The image above (at 2d) is of the Variables in the Design Library.

    When you go to Settings, Site options and look for Properties to enter you new keys it will look like this:

    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk

    Comment


      #3
      Thanks G.W.Green and thanks Jonathan for clarifying.
      Arka Tribal Jewellery

      Comment


        #4
        Originally posted by MattSMR
        Why does this vital information not get e-mailed out, yet we get an e-mail regarding a piece of software which isn't even SellerDeck...

        You offer files for V12,14,16 - Any tips on what to do for V11? We still have 3 sites on that platform.

        - Matt.
        Matt - I would use the configuration instructions that Gary has given for editing a modified MailForm.pl

        Search for 'recaptcha_challenge_field' as stated...

        Looks pretty similar to the others, we should be able to find our way around.

        Code:
        		#
        		# Get the reCAPTCHA fields
        		#
        		my $sRCChallenge = $::g_InputHash{'recaptcha_challenge_field'};
        		my $sRCResponse = $::g_InputHash{'recaptcha_response_field'};
        		if ($sRCResponse eq '' ||													# no response from user
        			$sRCChallenge eq '')														# challenge has been hacked
        			{
        			$sError = ACTINIC::GetPhrase(-1, 2753);							# no need to make a server call
        			}
        		else
        			{
        			my @arrResponse = 
        				CheckRecaptcha($sRCChallenge, $sRCResponse);					# check the response
        			if ($arrResponse[0] == $::FAILURE)									# if it failed
        				{
        				$sError = $arrResponse[1];											# save reason
        				}
        			}
        		}
        This is from v11
        Jonathan Chappell
        Website Designer
        SellerDeck Website Designer
        Actinic to SellerDeck upgrades
        Graphicz Limited - www.graphicz.co.uk

        Comment


          #5
          I use FormToEmailPro a lot and that has a recaptcha thing built in. The code in the file is similar so should be editable as this.

          (Hmmmm... but not so easy. Has anyone had a play? https://formtoemail.com/developer_pricing.php
          Jonathan Chappell
          Website Designer
          SellerDeck Website Designer
          Actinic to SellerDeck upgrades
          Graphicz Limited - www.graphicz.co.uk

          Comment


            #6
            Will reCAPTCHA v2 be included in v18 as standard?

            Comment


              #7
              Caution

              I have just done a v12 and the design snapshot downloadable from above overwrites the WHOLE contact us page, not just the reCaptcha bits! Plus Gary's version is not responsive.

              If you have a customised v12 (or any site I guess) site please note the contact us page will be overwritten and you will have to re-implement your contact us page design.

              FAO Gary
              Please can you do snaps with the recaptcha layouts updated but not wiping out the whole contact us page?

              These are the layouts in the snapshot that are upgraded:

              Code:
              Layouts,"ReCAPTCHA Layout","",1,"ReCAPTCHA","<div id=""recapchaWidget"" class=""g-recaptcha"" data-sitekey=""<actinic:variable name=""ReCAPTCHAPublicKey"" />""></div>",0,"",0,0,0
              Layouts,"ReCAPTCHA JS Options","",1,"ReCAPTCHA","<script src='https://www.google.com/recaptcha/api.js'></script>\r\n",0,"",0,0,0
              Layouts,"Contact Us Page Body","Bulk area of the contact us page",1,"Web Page Inner Layout","<div id=""contact-body"">\r\n<actinic:block if=""%3cactinic%3avariable%20name%3d%22ReCAPTCHAPublicKey%22%20%2f%3e%20%20%21%3d%20%22%22%20%20AND%20%3cactinic%3avariable%20name%3d%22ReCAPTCHAPrivateKey%22%20%2f%3e%20%20%21%3d%20%22%22"" >\r\n<actinic:block if=""%3cactinic%3avariable%20name%3d%22EnableReCAPTCHA%22%20%2f%3e%20%3d%3d%20true"" >\n	<actinic:variable name=""ReCaptchaOptions"" />\r\n</actinic:block>\r\n<form method=""post"" action=""<actinic:variable name=""SendMailPageURL"" />"">\r\n<input type=""hidden"" name=""RANDOM"" value=""<actinic:variable name=""Random"" />"" />\r\n          \r\n<actinic:block if=""%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e"" >\r\n   <!-- Hidden field when in trial mode -->\r\n   <input type=""hidden"" name=""SHOP"" value=""<actinic:variable name=""HiddenFields"" />"" />\r\n</actinic:block>\r\n\r\n<actinic:variable name=""ValidationError"" />\r\n<p><actinic:variable name=""MailFormHeader"" /></p>\r\n\r\n<table>\r\n   <tr> \r\n      <td>\r\n         <span class=""actrequired""><actinic:variable formatting=""style|actsmaller"" name=""MailFormName"" /> *</span> \r\n      </td>\r\n      <td>\r\n         <input type=""text"" class=""input-text"" name=""Name"" value=""<actinic:variable name=""MailFormNameValue"" />"" tabindex=""1"" /> \r\n      </td>\r\n   </tr>\r\n   <tr> \r\n      <td>\r\n         <span class=""actrequired""><actinic:variable name=""MailFormSubject"" /> *</span>\r\n      </td>\r\n      <td>\r\n         <input type=""text"" class=""input-text"" name=""Subject"" value=""<actinic:variable name=""MailFormSubjectValue"" />"" tabindex=""2"" /> \r\n      </td>\r\n   </tr>\r\n   <tr> \r\n      <td>\r\n         <span class=""actrequired""><actinic:variable name=""MailFormEmail"" /> *</span>\r\n      </td>\r\n      <td>\r\n         <input type=""text"" class=""input-text"" name=""EmailAddress"" value=""<actinic:variable name=""MailFormEmailValue"" />""  tabindex=""3"" /> \r\n      </td>\r\n   </tr>\r\n   <tr> \r\n      <td valign=""top"">\r\n         <span class=""actrequired""><actinic:variable name=""MailFormMessage"" /> *</span>\r\n      </td>\r\n      <td>\r\n         <textarea type=""text"" rows=""10"" cols=""45"" name=""Message"" tabindex=""4""><actinic:variable name=""MailFormMessageValue"" /></textarea>\r\n      </td>\r\n   </tr>\r\n<actinic:block if=""%3cactinic%3avariable%20name%3d%22EnableReCAPTCHA%22%20%2f%3e%20%3d%3d%20true"" >\n   <tr> \r\n      <td valign=""top"">&nbsp;</td>\r\n      <td>\r\n         <actinic:variable name=""ReCaptcha"" />\r\n      </td>\r\n   </tr>\r\n</actinic:block>\r\n   <tr> \r\n      <td valign=""top"">&nbsp;</td>\r\n      <td>\r\n         <input type=""submit"" name=""ACTION"" value=""<actinic:variable name=""MailFormSendButton"" />"" tabindex=""6"" />\r\n      </td>\r\n   </tr>\r\n   <tr> \r\n      <td valign=""top"">&nbsp;</td>\r\n      <td valign=""top"">\r\n         <actinic:variable name=""RequiredFields"" /> <span class=""actrequired""><actinic:variable name=""Highlighted"" /></span>.\r\n      </td>\r\n   </tr>\r\n</table>\r\n\r\n</form>\r\n</actinic:block>\r\n<actinic:block if=""%3cactinic%3avariable%20name%3d%22ReCAPTCHAPublicKey%22%20%2f%3e%20%20%3d%3d%20%22%22%20%20OR%20%20%3cactinic%3avariable%20name%3d%22ReCAPTCHAPrivateKey%22%20%2f%3e%20%20%3d%3d%20%22%22"" >\r\n<p><strong>Phone</strong>: <actinic:variable name=""Phone"" /></p>\r\n<actinic:block if=""%3cactinic%3avariable%20name%3d%22Fax%22%20%2f%3e%20%20%21%3d%20%22%22""><p><strong>Fax</strong>: <actinic:variable name=""Fax"" /></p></actinic:block>\r\n<p><strong><actinic:variable name=""CompanyName"" /></strong>\r\n	<actinic:block if=""%3cactinic%3avariable%20name%3d%22Address1%22%20%2f%3e%20%21%3d%20%22%22""><br/><actinic:variable name=""Address1"" />,</actinic:block>\r\n	<actinic:block if=""%3cactinic%3avariable%20name%3d%22Address2%22%20%2f%3e%20%21%3d%20%22%22""><br/><actinic:variable name=""Address2"" />,</actinic:block>\r\n	<actinic:block if=""%3cactinic%3avariable%20name%3d%22Address3%22%20%2f%3e%20%21%3d%20%22%22""><br/><actinic:variable name=""Address3"" />,</actinic:block>\r\n	<actinic:block if=""%3cactinic%3avariable%20name%3d%22Address4%22%20%2f%3e%20%21%3d%20%22%22""><br/><actinic:variable name=""Address4"" />,</actinic:block>\r\n	<actinic:block if=""%3cactinic%3avariable%20name%3d%22PostalCode%22%20%2f%3e%20%21%3d%20%22%22"" ><br/><actinic:variable name=""PostalCode"" />,</actinic:block><actinic:block if=""%3cactinic%3avariable%20name%3d%22Country%22%20%2f%3e%20%21%3d%20%22%22%20AND%20%3cactinic%3avariable%20name%3d%22PostalCode%22%20%2f%3e%20%21%3d%20%22%22"" > </actinic:block><actinic:block if=""%3cactinic%3avariable%20name%3d%22Country%22%20%2f%3e%20%21%3d%20%22%22"" ><br/><actinic:variable name=""Country"" />.</actinic:block>\r\n</p>\r\n</actinic:block>\r\n</div>",0,"",0,0,0
              Variable,"ReCAPTCHAPublicKey","ReCAPTACH Public Key",0,"",21,-1,1,"ReCAPTCHA","",1,"ReCAPTCHAPublicKey","","",0,"","",3,3,Middle Row First Column Before,Middle Row Mid Column Before,0,"",-1,0,Last Row Last Column Before,First Row After,1,0,0,0,0,0,0,0,0,"Properties",0,0,1,1,0,0
              Variable,"ReCAPTCHAPrivateKey","ReCAPTCHA Private Key",0,"",21,-1,1,"ReCAPTCHA","",1,"ReCAPTCHAPrivateKey","","",0,"","",0,0,Middle Row First Column Before,Middle Row Mid Column Before,0,"",-1,0,Last Row Last Column Before,First Row After,1,0,0,0,0,0,0,0,0,"Properties",0,0,1,1,0,0
              Jonathan Chappell
              Website Designer
              SellerDeck Website Designer
              Actinic to SellerDeck upgrades
              Graphicz Limited - www.graphicz.co.uk

              Comment


                #8
                These are the only two layout changes important for the v2 to work - as far as I can see.:

                This replaces the content of the ReCAPTCHA Layout

                Code:
                <div id="recapchaWidget" class="g-recaptcha" data-sitekey="<actinic:variable name=""ReCAPTCHAPublicKey" />
                This goes right at the bottom of Javascript Header Functions

                Code:
                <script src='https://www.google.com/recaptcha/api.js'></script>
                Do this instead of importing the snap and overwriting your carefully crafted contact us page!
                Jonathan Chappell
                Website Designer
                SellerDeck Website Designer
                Actinic to SellerDeck upgrades
                Graphicz Limited - www.graphicz.co.uk

                Comment


                  #9
                  v18

                  The v18 public beta is still using V1, but they still have a week or two to fix that.

                  Interestingly, the Pubic and Private keys no longer appear in Settings Site Options which is, I guess, why Gary included them in the v12 v14 and v16 snapshots (these versions DO however have the keys in site options.

                  Code:
                  Variable,"ReCAPTCHAPublicKey","ReCAPTACH Public Key",0,"",21,-1,1,"ReCAPTCHA","",1,"ReCAPTCHAPublicKey","","",0,"","",3,3,Middle Row First Column Before,Middle Row Mid Column Before,0,"",-1,0,Last Row Last Column Before,First Row After,1,0,0,0,0,0,0,0,0,"Properties",0,0,1,1,0,0
                  Variable,"ReCAPTCHAPrivateKey","ReCAPTCHA Private Key",0,"",21,-1,1,"ReCAPTCHA","",1,"ReCAPTCHAPrivateKey","","",0,"","",0,0,Middle Row First Column Before,Middle Row Mid Column Before,0,"",-1,0,Last Row Last Column Before,First Row After,1,0,0,0,0,0,0,0,0,"Properties",0,0,1,1,0,0
                  Jonathan Chappell
                  Website Designer
                  SellerDeck Website Designer
                  Actinic to SellerDeck upgrades
                  Graphicz Limited - www.graphicz.co.uk

                  Comment


                    #10
                    Double check...

                    Just received a Sellerdeck email regarding this (with a link to this thread)

                    I found something odd

                    We are on v16.0.4 RGVB (SQL)

                    For the values in Sellerdeck for ReCAPTHCAPrivateKey and ReCAPTHCAPublicKey:

                    Changing via : Design > Library > Variables
                    did not change on : Settings > Site Options > Properties
                    (and vice versa)

                    I changed them all manually, and works for us.

                    Comment


                      #11
                      Captcha V2

                      Well, that didn't work! I'm using v12 followed your instructions unzipped file but for some reason it won't import the site design, doesn't recognise file type. I must be missing something silly somewhere. Take me from unzipping, which bit do I import and how. I have two files: MailForm.pl and v12_design_reCAPTCHA.acd I've tried the acd file but not recognised, just get an error msg.
                      Any help appreciated.

                      Comment


                        #12
                        Its because the top level value for both is NOT use parent so whatever you put in the variable boxes WON'T reflect in Site Options. That is why I add my reply to Gary's post above. Frankly I am using the Google layouts directly into Recaptcha layout and recaptcha options (copied from the Google set up page with the keys) but adding the keys in Settings site options as per my post above will sort you out.
                        Jonathan Chappell
                        Website Designer
                        SellerDeck Website Designer
                        Actinic to SellerDeck upgrades
                        Graphicz Limited - www.graphicz.co.uk

                        Comment


                          #13
                          Couple of questions

                          Hi there,

                          Thanks for this, I have just been through it on one of my sites, on v16, and I have two questions.

                          Note, it is live and working.

                          1. When I look at the contacts page in design view a warning pops up:
                          Cannot contact reCAPTCHA. Check your connection and try again.
                          Do I need to worry about this?

                          2. On the Google reCAPTCHA page, there are some instructions under 'Client Side Configuration'. Do we have to follow these steps, or are they covered by the imported zip file?

                          Thanks for any advice.
                          Kind regards,
                          Phil Benjamin

                          Want to de-stress as you use SellerDeck software?
                          http://www.ursulajamesstore.com

                          Comment


                            #14
                            Forbidden

                            You don't have permission to access /newreply.php on this server.
                            Jonathan Chappell
                            Website Designer
                            SellerDeck Website Designer
                            Actinic to SellerDeck upgrades
                            Graphicz Limited - www.graphicz.co.uk

                            Comment


                              #15

                              You will need to extract the new revised MailForm.pl and paste it into your site 1 folder.
                              Jonathan Chappell
                              Website Designer
                              SellerDeck Website Designer
                              Actinic to SellerDeck upgrades
                              Graphicz Limited - www.graphicz.co.uk

                              Comment

                              Working...
                              X