Rename extension correctly

This commit is contained in:
Alma Armas 2020-07-10 13:54:28 +00:00
parent edaf907e8f
commit ea6f1f8dfc
4 changed files with 11 additions and 11 deletions

View file

@ -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");

View file

@ -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
{ {

View file

@ -1,2 +1,2 @@
services: services:
- captcha\Web\Presenters\CaptchaPresenter - commitcaptcha\Web\Presenters\CaptchaPresenter

View file

@ -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