Skip to content

Commit

Permalink
Применена новая версия пакета batumibiz/captcha
Browse files Browse the repository at this point in the history
  • Loading branch information
batumibiz committed Nov 7, 2019
1 parent f2d59be commit 6f9091f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -33,7 +33,7 @@
"ext-mbstring": "*",
"ext-pdo": "*",
"aura/autoload": "^2.0",
"batumibiz/captcha": "^2.0.1",
"batumibiz/captcha": "^3.0",
"league/plates": "^3.3",
"nikic/fast-route": "^1.3",
"verot/class.upload.php": "^2.0",
Expand Down
27 changes: 13 additions & 14 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions modules/login/index.php
Expand Up @@ -10,7 +10,6 @@
* @link https://johncms.com JohnCMS Project
*/

use Batumibiz\Captcha\Captcha;
use Johncms\Api\ConfigInterface;
use Johncms\Api\ToolsInterface;
use Johncms\Api\UserInterface;
Expand Down Expand Up @@ -101,12 +100,11 @@
} else {
// Показываем CAPTCHA
$display_form = 0;
$cap = new Captcha;
$code = $cap->generateCode();
$code = (string) new Batumibiz\Captcha\Code;
$_SESSION['code'] = $code;

echo $view->render('login::captcha', [
'captcha' => $cap->generateImage($code),
'captcha' => new Batumibiz\Captcha\Image($code),
'user_login' => $user_login,
'user_pass' => $user_pass,
'remember' => $remember,
Expand Down
5 changes: 2 additions & 3 deletions modules/registration/index.php
Expand Up @@ -183,8 +183,7 @@
echo '<div class="rmenu"><p>' . _t('You can get authorized on the site after confirmation of your registration.') . '</p></div>';
}

$captcha = new Batumibiz\Captcha\Captcha;
$code = $captcha->generateCode();
$code = (string) new Batumibiz\Captcha\Code;
$_SESSION['code'] = $code;

echo $view->render('reg::index', [
Expand All @@ -193,5 +192,5 @@
'reg_pass' => $reg_pass,
'reg_name' => $reg_name,
'reg_about' => $reg_about,
'captcha' => $captcha->generateImage($code),
'captcha' => new Batumibiz\Captcha\Image($code),
]);

0 comments on commit 6f9091f

Please sign in to comment.