Skip to content

Commit

Permalink
Update compatibility for SL 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jDanek committed Feb 3, 2024
1 parent 8cd161c commit b4c370d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions plugins/extend/recaptcha/class/ConfigAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Sunlight\Plugin\Action\ConfigAction as BaseConfigAction;
use Sunlight\Util\ConfigurationFile;
use Sunlight\Util\Form;
use Sunlight\Util\Request;

class ConfigAction extends BaseConfigAction
{
Expand All @@ -15,27 +16,27 @@ protected function getFields(): array
return [
'site_key' => [
'label' => _lang('recaptcha.site_key'),
'input' => '<input type="text" name="config[site_key]" value="' . Form::restorePostValue('site_key', $config['site_key'], false) . '">',
'input' => Form::input('text', 'config[site_key]', Request::post('config[site_key]', $config['site_key']), ['class' => 'inputmedium']),
'type' => 'text',
],
'secret_key' => [
'label' => _lang('recaptcha.secret_key'),
'input' => '<input type="text" name="config[secret_key]" value="' . Form::restorePostValue('secret_key', $config['secret_key'], false) . '">',
'input' => Form::input('text', 'config[secret_key]', Request::post('config[secret_key]', $config['secret_key']), ['class' => 'inputmedium']),
'type' => 'text',
],
'use_curl' => [
'label' => _lang('recaptcha.use_curl'),
'input' => '<input type="checkbox" name="config[use_curl]" value="1"' . Form::activateCheckbox($config['use_curl']) . '>',
'input' => Form::input('checkbox', 'config[use_curl]', '1', ['checked' => Form::loadCheckbox('config', $config['use_curl'], 'use_curl')]),
'type' => 'checkbox'
],
'use_recaptcha_v3' => [
'label' => _lang('recaptcha.use_recaptcha_v3'),
'input' => '<input type="checkbox" name="config[use_recaptcha_v3]" value="1"' . Form::activateCheckbox($config['use_recaptcha_v3']) . '>',
'input' => Form::input('checkbox', 'config[use_recaptcha_v3]', '1', ['checked' => Form::loadCheckbox('config', $config['use_recaptcha_v3'], 'use_recaptcha_v3')]),
'type' => 'checkbox'
],
'score_treshold' => [
'label' => _lang('recaptcha.score_treshold'),
'input' => '<input type="number" name="config[score_treshold]" min="0" max="1" step="0.1" value="' . Form::restorePostValue('score_treshold', $config['score_treshold'], false) . '" class="inputsmall">',
'input' => Form::input('text', 'config[score_treshold]', Request::post('config[score_treshold]', $config['score_treshold']), ['class' => 'inputsmall', 'step' => '0.1', 'min' => '0', 'max' => '1']),
],
];
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/extend/recaptcha/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"$schema": "../../../system/schema/extend.json",
"name": "ReCaptcha",
"description": "Protect forms by using the Google reCaptcha API",
"version": "1.0.0",
"version": "1.1.0",
"environment": {
"system": "^8.0"
"system": "^8.1"
},
"authors": [
{"name": "Friends of Sunlight CMS", "url": "https://github.com/friends-of-sunlight-cms/"}
Expand Down

0 comments on commit b4c370d

Please sign in to comment.