mirror of
https://github.com/openvk/commitcaptcha.git
synced 2024-11-15 03:31:11 +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);
|
<?php declare(strict_types=1);
|
||||||
namespace captcha;
|
namespace commitcaptcha;
|
||||||
use Nette\Utils\Image;
|
use Nette\Utils\Image;
|
||||||
use Chandler\Session\Session;
|
use Chandler\Session\Session;
|
||||||
use Chandler\Patterns\TSimpleSingleton;
|
use Chandler\Patterns\TSimpleSingleton;
|
||||||
|
@ -96,7 +96,7 @@ class CaptchaManager
|
||||||
|
|
||||||
function verifyCaptcha(string $input): bool
|
function verifyCaptcha(string $input): bool
|
||||||
{
|
{
|
||||||
if(!CAPTCHA_ROOT_CONF["captcha"]["enable"])
|
if(!COMMITCAPTCHA_ROOT_CONF["commitcaptcha"]["enable"])
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
$data = $this->session->get("captcha");
|
$data = $this->session->get("captcha");
|
||||||
|
@ -115,4 +115,4 @@ class CaptchaManager
|
||||||
}
|
}
|
||||||
|
|
||||||
use TSimpleSingleton;
|
use TSimpleSingleton;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php declare(strict_types=1);
|
<?php declare(strict_types=1);
|
||||||
namespace captcha\Web\Presenters;
|
namespace commitcaptcha\Web\Presenters;
|
||||||
use Chandler\MVC\SimplePresenter;
|
use Chandler\MVC\SimplePresenter;
|
||||||
use Nette\Utils\Image;
|
use Nette\Utils\Image;
|
||||||
use captcha\CaptchaManager;
|
use commitcaptcha\CaptchaManager;
|
||||||
|
|
||||||
class CaptchaPresenter extends SimplePresenter
|
class CaptchaPresenter extends SimplePresenter
|
||||||
{
|
{
|
||||||
|
@ -17,4 +17,4 @@ class CaptchaPresenter extends SimplePresenter
|
||||||
$image->send(Image::WEBP, 32);
|
$image->send(Image::WEBP, 32);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
services:
|
services:
|
||||||
- captcha\Web\Presenters\CaptchaPresenter
|
- commitcaptcha\Web\Presenters\CaptchaPresenter
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
<?php declare(strict_types=1);
|
<?php declare(strict_types=1);
|
||||||
use captcha\CaptchaManager;
|
use commitcaptcha\CaptchaManager;
|
||||||
|
|
||||||
function captcha_template(): string
|
function captcha_template(): string
|
||||||
{
|
{
|
||||||
$html = <<<'HTML'
|
$html = <<<'HTML'
|
||||||
<div class="captcha">
|
<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/>
|
<br/>
|
||||||
<input type="text" name="captcha" placeholder="Enter 8 characters" />
|
<input type="text" name="captcha" placeholder="Enter 8 characters" />
|
||||||
</div>
|
</div>
|
||||||
HTML;
|
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
|
function check_captcha(?string $input): bool
|
||||||
|
@ -19,4 +19,4 @@ function check_captcha(?string $input): bool
|
||||||
return CaptchaManager::i()->verifyCaptcha((string) $input);
|
return CaptchaManager::i()->verifyCaptcha((string) $input);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (function() {});
|
return (function() {});
|
||||||
|
|
Loading…
Reference in a new issue