commitcaptcha/Web/Presenters/CaptchaPresenter.php

21 lines
572 B
PHP
Raw Normal View History

2020-06-17 18:37:12 +03:00
<?php declare(strict_types=1);
2020-07-10 16:54:28 +03:00
namespace commitcaptcha\Web\Presenters;
2020-06-17 18:37:12 +03:00
use Chandler\MVC\SimplePresenter;
use Nette\Utils\Image;
2020-07-10 16:54:28 +03:00
use commitcaptcha\CaptchaManager;
2020-06-17 18:37:12 +03:00
class CaptchaPresenter extends SimplePresenter
{
function renderCaptcha()
{
$manager = CaptchaManager::i();
$image = $manager->getImage();
header("Pragma: no-cache");
header("Expires: Wed, 12 Feb 2003 00:00:00 GMT");
header("Cache-Control: no-cache, no-store, no-transform, must-revalidate");
$image->send(Image::JPEG);
2020-06-17 18:37:12 +03:00
exit;
}
2020-07-10 16:54:28 +03:00
}