Jump to content
Nabeel

Upgrading ReCaptcha to v2

Recommended Posts

8 minutes ago, mboddicker said:

Nabeel,

I have followed all of those instructions, but I still get a broken registration page.

 

What exactly is broken? I need more information than that. Any errors? Logs? Try editing the local.config.php and remove the E_WARNING from the error_reporting clause. There might have been an inadvertent error while editing

Share this post


Link to post
Share on other sites
4 minutes ago, mboddicker said:

You can see the registration page at the following link.  It doesn't load any of the styles and I get a 500 server error on the pages.

https://www.vdelta.org/index.php/registration

You made an error with editing the registration form. Make sure it's correct

Share this post


Link to post
Share on other sites

Ok, I found part of my problem.  I was changing the registration_mainform.tpl file in the Templates folder but I actually needed to modify it in the Skins\CCV1 folder.  Turning on the errors display helped there, however, I now get the following error on the registration page:

Fatal error: Call to undefined function recaptcha_get_html() in /home3/vdelta/public_html/lib/skins/CCV1/registration_mainform.tpl on line 110

Line 110 is the "echo recaptcha_get_html(Config::Get('RECAPTCHA_PUBLIC_KEY'), $captcha_error);" line.


        

Share this post


Link to post
Share on other sites
On 5/14/2018 at 11:05 PM, Nabeel said:

These instructions should work

https://gist.github.com/nabeelio/6380e05dbb8ce8c53765f0068f6515e3

Note: Make sure to make the changes in the skin you're currently using.

HI! 

the program Adobe Dreamweaver shows an error in this line -  $recaptcha = new \ReCaptcha\ReCaptcha(Config::Get('RECAPTCHA_PRIVATE_KEY'));

here is my entry:

protected function VerifyData()
    {
        $error = false;
        
        $recaptcha = new \ReCaptcha\ReCaptcha(Config::Get('RECAPTCHA_PRIVATE_KEY'));
        $resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
        if(!$resp->isSuccess())
         {
            $error = true;
            $this->set('captcha_error', $resp->error);
        } else {
          $this->set('captcha_error', '');
        }

Edited by coldpll

Share this post


Link to post
Share on other sites
11 hours ago, coldpll said:

HI! 

the program Adobe Dreamweaver shows an error in this line -  $recaptcha = new \ReCaptcha\ReCaptcha(Config::Get('RECAPTCHA_PRIVATE_KEY'));

 

But does it work? I wouldn't trust Dreamweaver, it's super old, and if it's giving you an error on that line, it means it doesn't know how to interpret namespaces. Use something like Atom or Visual Studio Code with PHP plugins.

  • Like 1

Share this post


Link to post
Share on other sites
21 hours ago, Nabeel said:

But does it work? I wouldn't trust Dreamweaver, it's super old, and if it's giving you an error on that line, it means it doesn't know how to interpret namespaces. Use something like Atom or Visual Studio Code with PHP plugins.

Thanks, but in any case does not work, even if I keep so. After the registration of errors does not issue - but registration does not pass!

I do everything according to the instructions.

in files (recaptcha-1.1.3\src....) nothing needs to be changed?

Edited by coldpll

Share this post


Link to post
Share on other sites
10 hours ago, coldpll said:

Thanks, but in any case does not work, even if I keep so. After the registration of errors does not issue - but registration does not pass!

I do everything according to the instructions.

in files (recaptcha-1.1.3\src....) nothing needs to be changed?

Nothing needs to be changed in there. Did you copy the files that are in src to the core/lib/recaptcha directory, or did you put the src directory in there? Does the recaptcha show up on the page? Did you remember to add the require_once in the core/bootstrap.inc.php file?

And did you register on the recaptcha site and get your key/secret and enter those into your local.config.php file?

Share this post


Link to post
Share on other sites
10 hours ago, Nabeel said:

Nothing needs to be changed in there. Did you copy the files that are in src to the core/lib/recaptcha directory, or did you put the src directory in there? Does the recaptcha show up on the page? Did you remember to add the require_once in the core/bootstrap.inc.php file?

And did you register on the recaptcha site and get your key/secret and enter those into your local.config.php file?

Thank you! yes of course I did everything according to the instructions. But there is the question - .gitignore? I found only a text (.txt) file with this name - it's not at all clear what it is for.

 reCAPTCHA can be seen on the site and it works, but the registration after does not work. Simply throws and offers again to register

Edited by coldpll

Share this post


Link to post
Share on other sites
16 hours ago, coldpll said:

Thank you! yes of course I did everything according to the instructions. But there is the question - .gitignore? I found only a text (.txt) file with this name - it's not at all clear what it is for.

 reCAPTCHA can be seen on the site and it works, but the registration after does not work. Simply throws and offers again to register

Don't worry about the gitignore file. Can you change your local/app.config.php files, the error reporting lines... change them to remove E_WARNING from them. Maybe there's some other kind of error. If that doesn't show anything, PM me.

Share this post


Link to post
Share on other sites
On 5/26/2018 at 1:10 AM, Nabeel said:

Don't worry about the gitignore file. Can you change your local/app.config.php files, the error reporting lines... change them to remove E_WARNING from them. Maybe there's some other kind of error. If that doesn't show anything, PM me.

ok. Thank you! 

Share this post


Link to post
Share on other sites
On 5/14/2018 at 1:05 PM, Nabeel said:

These instructions should work

https://gist.github.com/nabeelio/6380e05dbb8ce8c53765f0068f6515e3

Note: Make sure to make the changes in the skin you're currently using.

Hello, Nabeel!

Thank you so much for this information. Anyway, is there anything like this for the Contact form as well?

Regards!

Edited by Felipe

Share this post


Link to post
Share on other sites
4 minutes ago, Felipe said:

Hello, Nabeel!

Thank you so much for this information. Anyway, is there anything like this for the Contact form as well?

Regards!

Just make the same changes but on those pages/forms instead

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×