diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-05-08 12:56:34 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-05-08 12:56:34 +0000 |
| commit | 79a1564005f300ea9ee23a2769756e2e12001f96 (patch) | |
| tree | bdc67106dc370788efd9d725b46f2d08935540b1 /app | |
| parent | b56bb5506f46ae8f6ed249902cfcad2524c1f2af (diff) | |
introduce altcha/captcha, fixes #4113
Closes #4113
Merge request studip/studip!2965
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/accessibility/forms.php | 3 | ||||
| -rw-r--r-- | app/controllers/captcha.php | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/app/controllers/accessibility/forms.php b/app/controllers/accessibility/forms.php index 476f2fe..e240a6c 100644 --- a/app/controllers/accessibility/forms.php +++ b/app/controllers/accessibility/forms.php @@ -146,6 +146,9 @@ class Accessibility_FormsController extends StudipController } $this->form->addPart($personal_data_part); + + $this->form->addPart(new \Studip\Forms\Captcha()); + $this->form->setSaveButtonText(_('Barriere melden')); $this->form->setSaveButtonName('report'); $this->form->setURL($this->report_barrierURL()); diff --git a/app/controllers/captcha.php b/app/controllers/captcha.php new file mode 100644 index 0000000..37bac47 --- /dev/null +++ b/app/controllers/captcha.php @@ -0,0 +1,12 @@ +<?php +final class CaptchaController extends StudipController +{ + public function challenge_action(): void + { + $this->response->add_header( + 'Expires', + gmdate('D, d M Y H:i:s', time() + CaptchaChallenge::CHALLENGE_EXPIRATION) . ' GMT' + ); + $this->render_json(CaptchaChallenge::createNewChallenge()); + } +} |
