CakePHP 5.4 app for live polls: create via email without login, manage via secret admin link, join via code. Includes slide types (choice, wordcloud, open, scale, content), presenter mode, CSV export, captcha, throttling, tests and Gitea CI/deploy workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
1.1 KiB
PHP
26 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* Renders the configured captcha inside a form.
|
|
*
|
|
* @var \App\View\AppView $this
|
|
* @var array<string, mixed> $captcha Result of CaptchaInterface::challenge()
|
|
*/
|
|
$type = $captcha['type'] ?? 'none';
|
|
?>
|
|
<?php if ($type === 'math') : ?>
|
|
<div class="input text">
|
|
<label for="captcha-answer"><?= __('Sicherheitsfrage: Was ist {0}?', h($captcha['question'])) ?></label>
|
|
<input type="text" inputmode="numeric" pattern="-?[0-9]*" autocomplete="off" required
|
|
id="captcha-answer" name="<?= h($captcha['field']) ?>" class="input-short">
|
|
</div>
|
|
<?php elseif ($type === 'recaptcha') : ?>
|
|
<div class="input text">
|
|
<?php if (empty($captcha['siteKey'])) : ?>
|
|
<p class="hint hint--error"><?= __('reCAPTCHA ist aktiviert, aber nicht konfiguriert (RECAPTCHA_SITE_KEY fehlt).') ?></p>
|
|
<?php else : ?>
|
|
<div class="g-recaptcha" data-sitekey="<?= h($captcha['siteKey']) ?>"></div>
|
|
<?php $this->Html->script('https://www.google.com/recaptcha/api.js', ['block' => 'script', 'async' => true, 'defer' => true, 'once' => true]) ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php endif; ?>
|