HCaptcha by Intuition Machines Download 1.3

3.0
ph TheDoggyBrad Software Lab 1 year ago

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

Comments
ph TheDoggyBrad Software Lab Replied 1 year ago

Thanks @Dominik L, I am willing to add your translation in the future release.

German Dominik L Replied 1 year ago

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);
ph TheDoggyBrad Software Lab Replied 1 year ago

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

  • Thanks for ChatGPT's help and saving me for the extension of my current 2 hour headache.
ph TheDoggyBrad Software Lab Replied 1 year ago

I am fixing it right now.

Indonesian Arsalan Shah Replied 1 year ago

Question are you going to fix it or ignore it?

Indonesian Arsalan Shah Replied 1 year ago

You are welcome looking forward for you to fix the issue soon.

ph TheDoggyBrad Software Lab Replied 1 year ago

Thanks @Arsalan Shah, I am just a beginner in PHP.

Indonesian Arsalan Shah Replied 1 year ago

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

ph TheDoggyBrad Software Lab Replied 1 year ago

This is not a syntax error and what type of error is this?

ph TheDoggyBrad Software Lab Replied 1 year ago

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

Component

Developer: TheDoggyBrad
License ossnv4
Type: Authentication
Requires Ossn Version : 7.0
Latest Version: 1.3
Last Updated 1 year ago
Repository Url View Repository

Versions