Jump to content
alblua

noCaptcha reCaptcha for phpVMS

Recommended Posts

alblua    3

Hello all,

For those of you who know, Google has released a new version of the reCaptcha that doesn't have a Captcha: noCaptcha reCaptcha. Some more information can be found at http://www.google.co...ntro/index.html.

Now, I've figured out (kind of) on how to implement it (very easy change), so I'm hoping it's backwards compatible. If anyone is willing to give it a try, please try my code snippet. My development copy of phpVMS isn't working as I want it to due to the skin, and I'm too lazy to go into the admin panel to change the skin to crystal.

recaptchalib.php is attached, to install, go to (phpVMS isntall directory)\core\lib\recaptcha. Make sure to backup your old one! I'm not being held liable here. You were warned. :)

Thank you for anyone who tries, let me know how it goes.

-Albert Lua

recaptchalib.php

Share this post


Link to post
Share on other sites
alblua    3

Sounds great, Dave!

I'll test it once I get my messed up registration thing working again (I know how I messed it up, it's not pretty) :)

Share this post


Link to post
Share on other sites
alblua    3

Just a small issue, this part:

<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>

Removing allows me to see the registration page, but adding it back makes it dead (PHP kills the process), so I end up with a blank page.

Is it okay to take out, or should I got to 5.5? I tried going up, but looks like everything is changed so much that I can't quite do it without screwing up my current skin in progress.

Share this post


Link to post
Share on other sites
simpilot    2128

You can remove it if you want. It is a security feature of the later versions to help protect template files.

Share this post


Link to post
Share on other sites
alblua    3

Roger that.

Just letting you know, testing it with whatever version I used for my phpVMS fixed version I have in a different thread, it works extremely well! Great work!

Share this post


Link to post
Share on other sites
simpilot    2128

Noob question here !

Where do I actually add the two keys that we get from Google's recaptcha in PHPVMS 5.5 ?

Just copy the lines from the app.config.php file and place them in your local.config.php file then update your keys.

/* Keys for recaptcha, you can change these if you want to your own but it's a global key so it should just work */
Config::Set('RECAPTCHA_PUBLIC_KEY', '6LcklAsAAAAAAJqmghmMPOACeJrAxW3sJulSboxx');
Config::Set('RECAPTCHA_PRIVATE_KEY', '6LcklAsAAAAAAMeQy5ZBoDu8JOMTP-UL7ek1GedO');

Share this post


Link to post
Share on other sites
MikeTGV    0

Does it matter if we have the pages in the skins folder itself (/lib/skins/) or does it have to be in the /core/pages/ for it work ? I have tried with my pages on the skin folder and it doesn't seem to work.

Any workaround for this issue ?

Share this post


Link to post
Share on other sites
MikeTGV    0

I can switch back to the default way if there is no workaround.

UPDATE: It doesn't actually work after moving it back to its normal place. Im going to look into it a bit more and update you back.

UPDATE: I reinstalled phpVMS 5.5x and it seems to work now ! Probably had outdated or corrupt files.

Thank you for your help and time.

Edited by MikeTGV

Share this post


Link to post
Share on other sites
alblua    3

At the moment, phpVMS 5.5x is a big jump, my skins won't work, so I'm staying with my fixed and modified package of an older version. :)

Share this post


Link to post
Share on other sites
ahughes3    13

I updated my extended version registration and contact forms to this today. You can take a look at how it is done here -> https://github.com/D...45be818e948d96c

David,

I copied the files from your github and saved them in phpvms but now I have broken things. I suspect I did not copy things across properly. Is there a way I can download the amended files as a zip or something so I don't stuff up the copy and paste.

Thanks

Share this post


Link to post
Share on other sites
alblua    3

It's probably because of the big jump of versions; so much has been change (including template files are nonexistent) that I suggest you make a fresh install and then copy and paste code snippets back into phpVMS.

Share this post


Link to post
Share on other sites
ahughes3    13

Thanks AirbusAi342, my install is fresh. Apart from the skin this is the first thing I've tried doing.

I am pretty sure I have either missed out a ; or ?>, something like that but the files are in all sorts of colours and I can't quite tell if I've copied it all perfectly. I was just hoping David might be able, or someone, whizz me there files so I know they are correct. :)

Share this post


Link to post
Share on other sites
ahughes3    13

Ok so I worked out partly what I did wrong. I copied the code direct from the view window which copied a load of additional characters. Having cleared those out the code still shows me a number of errors which I don;t know how to fix. Is there another way round this captcha issue because at the moment no pilots can register and I need to sort it.

Anyone else found an easier way to fix it?

Share this post


Link to post
Share on other sites
alblua    3

What are the errors exactly?

Just going to say, I'm going off a lack of sleep, so I might not be able to understand what I usually would, :P. Too much stuff to do.

Share this post


Link to post
Share on other sites
t_bergman    21

What files were you editing, just re upload them and start again.

Correct, you can always start new by backing up your skin folder and local.config.php file. Any editied file should be placed in your skin folder if possible.

Share this post


Link to post
Share on other sites
ahughes3    13

@t_bergman - next time post sooner!!! You'd have saved me sooooo much wasted time! :P Just kiddin. Your response in one of my other posts was a great help. Fortunately I had backed up all the files I had changed so I just deleted the modified files and restored the old ones. Then I got myself a new captcha key from Google, entered it into the local.config.php and it's all working perfectly.

Thanks again for the support and responses :D

Share this post


Link to post
Share on other sites
mark1million    159

You can go to google and register your own set of keys if needed, the url changed a while ago for captcha the settings are in the config file but if you do change them place it in your local config file.

Existing keys should look like,

/* Keys for recaptcha, you can change these if you want to your own but it's
a global key so it should just work */
Config::Set('RECAPTCHA_PUBLIC_KEY', '6LcklAsAAAAAAJqmghmMPOACeJrAxW3sJulSboxx');
Config::Set('RECAPTCHA_PRIVATE_KEY', '6LcklAsAAAAAAMeQy5ZBoDu8JOMTP-UL7ek1GedO');

Share this post


Link to post
Share on other sites
OWA001    0

Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/oneworl1/public_html/core/lib/recaptcha/recaptchalib.php on line 93

Warning: file_get_contents(https://www.google.com/recaptcha/api/siteverify?secret=6LcbnwoUAAAAAMIr-2qxPKs2P1uW6Ii9OZGMlAw9&remoteip=187.244.42.78&v=php_1.0&response=03AIezHSZVR8ikYR7dCkpjPazR4Ym5d0BsYwlL3ji4bbLH8LXPEjh4agigGZuOBseyMM_LEBlpcFhr8Gib3iPPrgGEazcgaRrzt2kEef58Vbd5ucey5f9uTSBI6y4Mx2fWsAwIRg7WhY3bFYFjgWTeWeC3Q0rbLOitydtMsWwSFoDkXz6te0Ay_-_FbqQkl5K2NMGsFj9_tEgPaenvwGb1Apf4wVD1ywNs0-24pkD8b4WqL2i15x1CHgbiyH9HVn1kBnw-zDw7D8jpA4l7ALOFiMiFPBcVVTmHUsz5UfOX4E-O5uzx-R0ot_JwX34hOudktH9ydm9x0cqO4U1qAckRX396C9PY6gsm_iS4BGLb9PUueUiNS7WKCWLh68oETX5FbMYLUOdPYQdrfBVW3XMw5ulHvSLkRVxqhQ): failed to open stream: no suitable wrapper could be found in /home/oneworl1/public_html/core/lib/recaptcha/recaptchalib.php on line 93

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

This is what comes out in my registration form, I tried everything I have suggested in the forum, the installation is new but I have not been able to start the registry.

They could help me they are very new in php but old in phpvms

Share this post


Link to post
Share on other sites
OWA001    0

 

On 2017-5-2 at 0:04 PM, servetas said:

What is your website url?

I have solved my problem, returning to the previous re-captcha system, until this has solution, just change all the files in the original phpvms folder of Nabeel (phpvms 1.1) and replace them with the 5.5.2 of David Clark (5.5.2)

 

the files show these

public_html/core/lib/recaptcha/ *.php (all files) (previus backup folders)

public_html/core/modules/Registration/Registration.php

public_html/core/templates/registration_mainform.tpl (changed .tpl for .php),

the public key and secret key its the same.

this a site url. (under construction).

http://oneworldv.com

Share this post


Link to post
Share on other sites
Heritage1    3

The recaptcha key is free, as mentioned above, however, for those who do not want to mess with it, I've enclosed a bypass file which completely eliminates the recaptcha process all together. I DO NOT recommend this, but if your looking to get started quickly, then please see the enclose file. This will put and overwrite the

Registration.php file, Make sure you always backup up. I just rename things on the Server, example; Registration.php.backup , this usually works great. If you so choose to use this file, do remember to keep a very close eye on applications pending, your open for bots ! Upload the file to the following :: /myserver/core/modules/Registration/Registration.php , You will at least be able to get your Registration up quickly until you fix your issues. Hope this helps you !

Jimbo

Registration.zip

Share this post


Link to post
Share on other sites
OWA001    0
On 28/6/2017 at 0:04 PM, MichiGobeli said:

Hello mate, if you still have the problem with Captcha, I suggest you change to the previous version, I did it and I do not currently have a problem for it, just change the phpvms version 1.1 the folders concerning the captcha
[your site.web] / core / lib / recaptcha, (logically creates a copy of everything before you start), all the files in that folder.

The rest is simply changing the recaptcha box like this in the .tpl version.

I hope that you serve or this information helps you, for any doubt if I can help you we are in contact.

regards

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


×