diff --git a/CHANGELOG.md b/CHANGELOG.md index f092fd9f..8765f2df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ **Merged pull requests:** - Release v2.1.5-2023.08 🎉 +- Captcha improvements [\#229](https://github.com/torrentpier/torrentpier-lts/pull/229) ([belomaxorka](https://github.com/belomaxorka)) - Show renamed topic actions in log actions [\#227](https://github.com/torrentpier/torrentpier-lts/pull/227) ([belomaxorka](https://github.com/belomaxorka)) - Show set/unset downloaded actions in log actions [\#226](https://github.com/torrentpier/torrentpier-lts/pull/226) ([belomaxorka](https://github.com/belomaxorka)) - Show pin & unpin actions in log actions [\#225](https://github.com/torrentpier/torrentpier-lts/pull/225) ([belomaxorka](https://github.com/belomaxorka)) diff --git a/library/includes/functions.php b/library/includes/functions.php index f2aa530a..e4e0aabc 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -2815,14 +2815,18 @@ function hash_search ($hash) function bb_captcha ($mode, $callback = '') { - global $bb_cfg, $userdata; + global $bb_cfg, $lang; require_once(CLASS_DIR .'recaptcha.php'); $secret = $bb_cfg['captcha']['secret_key']; $public = $bb_cfg['captcha']['public_key']; $theme = $bb_cfg['captcha']['theme']; - $lang = $bb_cfg['lang'][$userdata['user_lang']]['captcha']; + + if (!$public && !$secret) + { + bb_die($lang['CAPTCHA_SETTINGS']); + } $reCaptcha = new ReCaptcha($secret); @@ -2840,7 +2844,7 @@ function bb_captcha ($mode, $callback = '') };
- "; + "; break; case 'check': diff --git a/library/language/en/main.php b/library/language/en/main.php index 6205fae0..98660571 100644 --- a/library/language/en/main.php +++ b/library/language/en/main.php @@ -2803,3 +2803,4 @@ $lang['UPLOAD_ERRORS'] = array( // Captcha $lang['CAPTCHA'] = 'Check that you are not a robot'; $lang['CAPTCHA_WRONG'] = 'You could not confirm that you are not a robot'; +$lang['CAPTCHA_SETTINGS'] = 'If you haven\'t already generated the keys, you can do it on https://www.google.com/recaptcha/admin.
After you generate the keys, you need to put them at the file library/config.php.
Если вы еще не сгенерировали ключи, вы можете это сделать на странице https://www.google.com/recaptcha/admin.
После того, как вы сгенерируете ключи, нужно прописать их в файл library/config.php.
Якщо ви ще не згенерували ключі, ви можете це зробити на сторінці https://www.google.com/recaptcha/admin.
Після того, як ви сгенеріруете ключі, потрібно прописати їх у файл library/config.php.