hCaptcha by Intuition Machines
Add a hCAPTCHA on forms, a modified ReCaptcha v2 component by Jonathan Goncalves
Requires:
✓OSSN Version 5.6 or higher (tested up to 7.0)
✓OSSN Components Captcha, ReCaptcha and ReCaptcha3 disabled
Where the hCaptcha will be added?
✓Reset Password Page
✓Signup/Register Page
How to use this component?
1.) https://dashboard.hcaptcha.com/login and make sure to make your account and find your Account Secret Key on your Account Settings page link by clicking your profile picture and save the generated Account Secret Key.
2.) Click the sites link and add your domain, make sure to also save the Site Key.
3.) Go to /administrator of your site and click the Configure dropdown menu and click "hcaptcha".
4.) Fill in the proper Account Secret Key and Site Key
Alternative Download Link:
https://github.com/thedoggybrad/hcaptcha-ossn/releases/download/1.3/hcaptcha.zip
Currently Translated Languages
✓English (en) by TheDoggyBrad
✓German (de) by Dominik L
Just post your customized translation file here and I will push it into a release if I had time.
Development Status: STABLE
Thanks @Dominik L, I am willing to add your translation in the future release.
Works great
if needed:
German locale:
<?php
$de = array(
'hcaptcha' => 'hCAPTCHA von Intuition Machines',
'hcaptcha:text' => 'Bitte füllen Sie das hcaptcha aus',
'hcaptcha:error' => 'Sie haben ein ungültiges hcaptcha eingegeben',
'hcaptcha:com:site_key' => 'hcaptcha SITE_KEY',
'hcaptcha:com:secret_key' => 'hcaptcha ACCOUNT_SECRET_KEY',
'hcaptcha:com:note' => 'Wir benötigen die API-Schlüssel. Gehen Sie zu <a href="https://dashboard.hcaptcha.com/">https://dashboard.hcaptcha.com/</a>. Um Zugriff auf diese Seite zu erhalten, müssen Sie auf Ihr hCaptcha-Konto zugreifen. Registrieren Sie den Namen Ihrer Website, auf der dieses hCAPTCHA verwendet wird. Danach fügen Sie sowohl ACCOUNT_SECRET_KEY als auch SITE_KEY in jedes Feld hier ein.',
'hcaptcha:site_key:empty' => 'Das SITE_KEY-Feld ist leer.',
'hcaptcha:secret_key:empty' => 'Das SECRET_KEY-Feld ist leer.',
'hcaptcha:saved' => 'API-Schlüssel erfolgreich gespeichert!',
'hcaptcha:save:error' => 'Die API-Schlüssel können nicht gespeichert werden.',
);
ossn_register_languages('de', $de);
Version 1.2
Fixes this one, discovered by Arsalan Shah, very special thanks to him.
The error means that $params['hcaptcha']->hcaptchasitekey is not set and $params['hcaptcha'] contains the boolean its not a object. So you can not access $params['hcaptcha']->hcaptchasitekey unless admin save it first on settings page wit site key and site secret. So you need to fix the logic and don't access $params['hcaptcha']->hcaptchasitekey unless it is set. You need to see if $params['hcaptcha']->hcaptchasitekey is set or not and $params['hcaptcha'] is not a boolean
I am fixing it right now.
Question are you going to fix it or ignore it?
You are welcome looking forward for you to fix the issue soon.
Thanks @Arsalan Shah, I am just a beginner in PHP.
You developed this component and I already mentioned what is the error, (PHP WARNING) so you need to fix this error. The error appears if there is no settings saved. You can not just disable errors and ignore it.
The error means that $params['hcaptcha']->hcaptcha_site_key
is not set and $params['hcaptcha']
contains the boolean its not a object. So you can not access $params['hcaptcha']->hcaptcha_site_key
unless admin save it first on settings page wit site key and site secret. So you need to fix the logic and don't access $params['hcaptcha']->hcaptcha_site_key
unless it is set. You need to see if $params['hcaptcha']->hcaptcha_site_key
is set or not and $params['hcaptcha']
is not a boolean
This is not a syntax error and what type of error is this?
What's wrong here:
•Line 4 (Error 1)
<input type="text" name="hcaptcha_site_key" value="<?php echo $params['hcaptcha']->hcaptcha_site_key;?>" />
•Line 8 (Error 2)
<input type="text" name="hcaptcha_secret_key" value="<?php echo $params['hcaptcha']->hcaptcha_secret_key;?>" />
What's wrong here?
Full Code (because the OSSN's typing box brokes the code):
https://github.com/thedoggybrad/hcaptcha-ossn/blob/main/plugins/default/forms/hcaptcha/admin.php