mirror of
https://github.com/openvk/commitcaptcha.git
synced 2024-12-22 08:30:57 +03:00
Rename extension correctly
This commit is contained in:
parent
edaf907e8f
commit
ea6f1f8dfc
4 changed files with 11 additions and 11 deletions
|
@ -1,5 +1,5 @@
|
|||
<?php declare(strict_types=1);
|
||||
namespace captcha;
|
||||
namespace commitcaptcha;
|
||||
use Nette\Utils\Image;
|
||||
use Chandler\Session\Session;
|
||||
use Chandler\Patterns\TSimpleSingleton;
|
||||
|
@ -96,7 +96,7 @@ class CaptchaManager
|
|||
|
||||
function verifyCaptcha(string $input): bool
|
||||
{
|
||||
if(!CAPTCHA_ROOT_CONF["captcha"]["enable"])
|
||||
if(!COMMITCAPTCHA_ROOT_CONF["commitcaptcha"]["enable"])
|
||||
return true;
|
||||
|
||||
$data = $this->session->get("captcha");
|
||||
|
@ -115,4 +115,4 @@ class CaptchaManager
|
|||
}
|
||||
|
||||
use TSimpleSingleton;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php declare(strict_types=1);
|
||||
namespace captcha\Web\Presenters;
|
||||
namespace commitcaptcha\Web\Presenters;
|
||||
use Chandler\MVC\SimplePresenter;
|
||||
use Nette\Utils\Image;
|
||||
use captcha\CaptchaManager;
|
||||
use commitcaptcha\CaptchaManager;
|
||||
|
||||
class CaptchaPresenter extends SimplePresenter
|
||||
{
|
||||
|
@ -17,4 +17,4 @@ class CaptchaPresenter extends SimplePresenter
|
|||
$image->send(Image::WEBP, 32);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
services:
|
||||
- captcha\Web\Presenters\CaptchaPresenter
|
||||
- commitcaptcha\Web\Presenters\CaptchaPresenter
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<?php declare(strict_types=1);
|
||||
use captcha\CaptchaManager;
|
||||
use commitcaptcha\CaptchaManager;
|
||||
|
||||
function captcha_template(): string
|
||||
{
|
||||
$html = <<<'HTML'
|
||||
<div class="captcha">
|
||||
<img src="/captcha/captcha.webp" alt="Captcha" style="margin-bottom: 8px; width: 130px;" />
|
||||
<img src="/commitcaptcha/captcha.webp" alt="Captcha" style="margin-bottom: 8px; width: 130px;" />
|
||||
<br/>
|
||||
<input type="text" name="captcha" placeholder="Enter 8 characters" />
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
return CAPTCHA_ROOT_CONF["captcha"]["enable"] ? $html : "You have already verified that you are not a robot.";
|
||||
return COMMITCAPTCHA_ROOT_CONF["commitcaptcha"]["enable"] ? $html : "You have already verified that you are not a robot.";
|
||||
}
|
||||
|
||||
function check_captcha(?string $input): bool
|
||||
|
@ -19,4 +19,4 @@ function check_captcha(?string $input): bool
|
|||
return CaptchaManager::i()->verifyCaptcha((string) $input);
|
||||
}
|
||||
|
||||
return (function() {});
|
||||
return (function() {});
|
||||
|
|
Loading…
Reference in a new issue