Happy New Year Gift!

This discussion is related to the No Captcha ReCaptcha addon.

I know that some people have been asking for this.

So I thought it would be a good new year's eve project.

For those that don't know Google reCAPTCHA has a new improved API

https://www.google.com/recaptcha/intro/index.html

This plugin will add a registration option for it.

grep is your friend.

Tagged:
R_JBleistivthgtonightAdrianphreakperegrineShadowdarejackmaessenMakke375Deprecatedz
«13

Comments

  • Unfortunately this breaks user registration. I continually get the error "passwords do not match," while this is enabled. Disabling it fixes the problem. Could this be related to the body tag?

  • x00x00 MVP
    edited January 2015

    is it a public site? Could be malformed markup.

    grep is your friend.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited January 2015

    If you want to use the dark theme for the box you can add parameters to the div that holds the box , in the case below I went with the dark theme adding data-theme="dark" if you want audio instead of image add data-type="audio"

    function recaptcha_get_html($CaptchaPublicKey, $Error = NULL, $UseSsl = FALSE){
            return'<div class="g-recaptcha" data-theme="dark" data-sitekey="'.$CaptchaPublicKey.'"></div>';
        }
    }
    

    https://developers.google.com/recaptcha/docs/display

    nc.png 146.1K
  • @vrijvlinder said:
    If you want to use the dark theme for the box you can add parameters to the div that holds the box....

    I take it the plugin works for you?

    I'll change to this:

    function recaptcha_get_html($CaptchaPublicKey, $Error = NULL, $UseSsl = FALSE){
        $Attributes =  C('Plugins.NoCaptchaReCaptcha.Attributes', array());
        $Attributes = array_merge($Attributes,array('class'=>'g-recaptcha', 'data-sitekey'=>$CaptchaPublicKey));
        $Plugin = Gdn::PluginManager()->GetPluginInstance('NoCaptchaReCaptcha');
        if($Plugin){
            $Plugin->EventArguments['Attributes'] = &$Attributes;
            $Plugin->FireEvent('BeforeDivReturn');
        }
        return'<div '.Attribute($Attributes).'></div>';
    }
    

    Then you can set $Configuration['Plugins']['NoCaptchaReCaptcha']['Attributes']= array('data-theme'=>'dark');

    grep is your friend.

    hgtonight
  • Very nice.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    @Nitwit said:
    Unfortunately this breaks user registration. I continually get the error "passwords do not match," while this is enabled.

    I got that too. I think the form is too sensitive on focus.
    If you ignore the error and go to the captcha and enter the text, it says verified you are not a robot and the page refreshes. The password seems to have been accepted because it does not say that it does not match anymore. However you get the Humanity is suspect error even if you entered the text correctly.

    So something is not working . Maybe the server side validation...

    The same key you had for the old captcha seems to be the same for this one since it is site wide. I could not get new keys or rather no new keys are available.

  • HazuluHazulu New
    edited January 2015

    Yeah, Even if I put in the same password it still tells me they don't match. I can still hit sign up and everything goes through normally and the account does get registered. (This was on localhost)

    vrijvlinder
  • thanks for the feedback.

    grep is your friend.

  • When people get "password don't match" is this the dynamic typing check, or is it after submission?

    grep is your friend.

  • Ok regarding the password check I think I can reproduce the error, will make a fix shortly.

    grep is your friend.

  • Ok here we go

    http://vanillaforums.org/addon/nocaptcharecaptcha-plugin

    @vrijvlinder I have put some error handling but I would still like an url, becuase it could be a javascript issue.

    grep is your friend.

  • Hi. The new version 0.1.3b seems to be broken. I just deactivated the older one... deleted it from the server.... uploaded the new version... and when I now try to activate the plugin I get the following error message:

    'The addon could not be enabled because it generated a fatal error'

  • Good catch. That is an enabling only relating issue. Will update the plugin.

    grep is your friend.

  • Hi. Right now I tested version 0.1.4b. Unfortunately same error as with former version 0.1.3b. :(
    Rolling back to version 0.1.1b which is working (apart from the known bug)...

    Makke375
  • @Stoertebecker said:
    Hi. Right now I tested version 0.1.4b. Unfortunately same error as with former version 0.1.3b. :(
    Rolling back to version 0.1.1b which is working (apart from the known bug)...

    it should not produce an error, try merging files without disabling. Or if you disable, set the current registration method to something else.

    grep is your friend.

  • x00x00 MVP
    edited January 2015

    If you want to find out what the error is put

    $Configuration['Debug'] = TRUE;

    in config.php

    then enable the plugin.

    grep is your friend.

  • Ok... here is the error message:

    Fatal error: Can't use function return value in write context in /home/xxxxxx/public_html/plugins/NoCaptchaReCaptcha/default.php on line 156

Sign In or Register to comment.