reCAPTCHA public key & private key - are you a human better solution!
Permalink 1 user found helpful
Hi,
with reCAPTCHA I don't get input fields for public key and private key in Dashboard / captcha (see attached screenshot), so I want to find a way to edit the special file, where these keys are stored in Concrete5, to put them in manually.
Can somebody please tell me, where these keys are stored?
Mike
with reCAPTCHA I don't get input fields for public key and private key in Dashboard / captcha (see attached screenshot), so I want to find a way to edit the special file, where these keys are stored in Concrete5, to put them in manually.
Can somebody please tell me, where these keys are stored?
Mike
Hi Rony,
I downloaded reCAPTCHA 1.1 from here:
https://github.com/concrete5/addon_recaptcha...
unpacked it into Packages, as any theme or add-on and installed normally.
I did this several times on latest english & german concrete5.
Mike
I downloaded reCAPTCHA 1.1 from here:
https://github.com/concrete5/addon_recaptcha...
unpacked it into Packages, as any theme or add-on and installed normally.
I did this several times on latest english & german concrete5.
Mike
You can have a try to uninstall & reinstall the package.
Ohh! got it. Seems like your server doesn't support php short tag.
This is the original code
Need to alter with this one
Note: The <?= tag is being replaced with <?php tag. You need to do this for all of them. The path is ROOT\packages\recaptcha\elements\system\captcha\recaptcha\form.php
Rony
This is the original code
<?=$form->label('CAPTCHA_RECAPTCHA_PUBLIC_KEY', t('Public Key'))?>
Need to alter with this one
<?php $form->label('CAPTCHA_RECAPTCHA_PUBLIC_KEY', t('Public Key'))?>
Note: The <?= tag is being replaced with <?php tag. You need to do this for all of them. The path is ROOT\packages\recaptcha\elements\system\captcha\recaptcha\form.php
Rony
Wrong.
<?= tag should be replaced with <?php echo and not with just <?php
Besides, this is not exactly a short tag, it is always available from PHP 5.3 onwards and will be available in PHP6, where short tags are being deprecated.
So search for "<?=" and replace it with "<?php echo ".
Also, this shouldn't be a problem in your case for plenty of reasons.
Can I have a live URL?
<?= tag should be replaced with <?php echo and not with just <?php
Besides, this is not exactly a short tag, it is always available from PHP 5.3 onwards and will be available in PHP6, where short tags are being deprecated.
So search for "<?=" and replace it with "<?php echo ".
Also, this shouldn't be a problem in your case for plenty of reasons.
Can I have a live URL?
You are right. I've missed out the echo. But I'm not sure about the version. Have you seen the attached screenshot? Its more likely it doesn't parse the tag. So if the server supports that tag, it should parse and display it properly.
Rony
Rony
I was a bit lazy to check the PHP changelog.
It's a 5.4 change. So you should be right because most web hosts haven't yet implemented 5.4 for reasons like lacking the Suhosin patch and general compatibility issues.
It's a 5.4 change. So you should be right because most web hosts haven't yet implemented 5.4 for reasons like lacking the Suhosin patch and general compatibility issues.
> Can I have a live URL? <
The server is down at this moment, but when I'll be at home in about 3 hours, I'll start it.
The server is down at this moment, but when I'll be at home in about 3 hours, I'll start it.
> Ohh! got it. Seems like your server doesn't support php short tag.<
Hmm, I'm also running phpBB forum software for 8 months on this server, which does support reCAPTCHA!
Any ideas?
Hmm, I'm also running phpBB forum software for 8 months on this server, which does support reCAPTCHA!
Any ideas?
This is not related to reCAPTCHA but to the way it is displayed.
It's a small thing, really. If a piece of code begins with "<?=" instead of "<?php echo ", your server might misinterpret it and show it as plain text instead of executing it.
It's a small thing, really. If a piece of code begins with "<?=" instead of "<?php echo ", your server might misinterpret it and show it as plain text instead of executing it.
Thanks! I'll try it instantly, when I'm at home. :)
So now after editing form.php, "<?=" is not found anywhere in concrete5 folder. :)
There must be another reason for reCAPTCHA behavior. :-/
There must be another reason for reCAPTCHA behavior. :-/
Nearly solved :)
Now I can put in keys, but cannot save them.
I get a window with:
and the guestbook window looks like attachment.
Mike
Now I can put in keys, but cannot save them.
I get a window with:
saveConfig('CAPTCHA_RECAPTCHA_PUBLIC_KEY', $args['CAPTCHA_RECAPTCHA_PUBLIC_KEY']); $pkg->saveConfig('CAPTCHA_RECAPTCHA_PRIVATE_KEY', $args['CAPTCHA_RECAPTCHA_PRIVATE_KEY']); $pkg->saveConfig('CAPTCHA_RECAPTCHA_THEME', $args['CAPTCHA_RECAPTCHA_THEME']); } public function display() { $pkg = Package::getByHandle('recaptcha'); Loader::library('3rdparty/recaptchalib', 'recaptcha'); print ''; print ''; print recaptcha_get_html($pkg->config('CAPTCHA_RECAPTCHA_PUBLIC_KEY')); } public function label() { $form = Loader::helper('form'); print $form->label('captcha', t('Verify yourself.')); } public function showInput() {} public function check() { $pkg = Package::getByHandle('recaptcha'); Loader::library('3rdparty/recaptchalib', 'recaptcha'); $resp = recaptcha_check_answer($pkg->config('CAPTCHA_RECAPTCHA_PRIVATE_KEY'), $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"] ); return $resp->is_valid; } } Fatal error: Class 'RecaptchaSystemCaptchaTypeController' not found in /Library/WebServer/Documents/en/concrete/core/models/system/captcha/library.php on line 129
and the guestbook window looks like attachment.
Mike
There are reCAPTCHA and 'Are You A Human' addons in the PRB at the moment. I believe both will be free.
Hmm, this thread IS about reCAPTCHA. :)
I'm using it already, but there are problems with my server (Mac), which I have to resolve - with this thread, I hope. :)
I'm using it already, but there are problems with my server (Mac), which I have to resolve - with this thread, I hope. :)
Here's the file you need.
Extract this file to your /packages/ directory.
It replaces one file (so yes, replace it when asked).
You missed a space after your "echo" command, so you had statements like echo$form->blabla instead of echo $form->blabla.
Extract this file to your /packages/ directory.
It replaces one file (so yes, replace it when asked).
You missed a space after your "echo" command, so you had statements like echo$form->blabla instead of echo $form->blabla.
Hmm, I still get errors like attachment:
And yes, I deleted cache in c5 and browser, before.
And yes, I deleted cache in c5 and browser, before.
Maybe I could edit the destination file and put in personal and private key manually?
But I don't know, which file. :-/
But I don't know, which file. :-/
I have MY solution !!!
Many, many thanks to MoonGrab and ronyDdeveloper!
Especially MoonGrab spent much time on this problem!
So it's not reCAPTCHA - the solution is: Are You A Human!
And remember, I'm running concrete5.6.1.2 an a Mac mini with Mac OS X SERVER 10.6.8 Snow Leopard, Apache 2.2.22, PHP 5.3.15 and MySQL(i) 5.0.92.
So maybe it won't work on other systems.
As I didn't find a solution for captcha and then reCAPTCHA to work on my system, I installed "addon_are_you_a_human-master.zip" from here:
https://github.com/concrete5/addon_are_you_a_human...
When installing, I didn't succeed: no input for Publisher Key & Scoring Key. :(
So I tried the trick of MoonGrab and ronyDdeveloper and changed
"<?=" with "<?php echo " (without the ") in 2 files (install_post.php & form.php) several times and BINGO, this works!
When installing are_you_a_human, I got a message:
but nevertheless the installation DOES work!
Hope this will also help others. :)
Mike
Many, many thanks to MoonGrab and ronyDdeveloper!
Especially MoonGrab spent much time on this problem!
So it's not reCAPTCHA - the solution is: Are You A Human!
And remember, I'm running concrete5.6.1.2 an a Mac mini with Mac OS X SERVER 10.6.8 Snow Leopard, Apache 2.2.22, PHP 5.3.15 and MySQL(i) 5.0.92.
So maybe it won't work on other systems.
As I didn't find a solution for captcha and then reCAPTCHA to work on my system, I installed "addon_are_you_a_human-master.zip" from here:
https://github.com/concrete5/addon_are_you_a_human...
When installing, I didn't succeed: no input for Publisher Key & Scoring Key. :(
So I tried the trick of MoonGrab and ronyDdeveloper and changed
"<?=" with "<?php echo " (without the ") in 2 files (install_post.php & form.php) several times and BINGO, this works!
When installing are_you_a_human, I got a message:
but nevertheless the installation DOES work!
Hope this will also help others. :)
Mike
I'm having exactly the same error messages on my system - just finding my way around C5 - it's running on IIS8 on Windows8 in case it makes any difference.
Rony