Make the captcha challenges more user friendly.

This commit is contained in:
Alex Tselegidis 2022-01-26 22:04:33 +01:00
parent 05e6704e67
commit 050478492c
3 changed files with 5 additions and 2 deletions

View File

@ -450,7 +450,7 @@ class Booking extends EA_Controller {
$captcha_phrase = session('captcha_phrase');
// Validate the CAPTCHA string.
if ($require_captcha && $captcha_phrase !== $captcha)
if ($require_captcha && strtoupper($captcha_phrase) !== strtoupper($captcha))
{
json_response([
'captcha_verification' => FALSE

View File

@ -27,6 +27,10 @@ class Captcha extends EA_Controller {
public function index()
{
$builder = new CaptchaBuilder;
$builder->setDistortion(false);
$builder->setMaxBehindLines(1);
$builder->setMaxFrontLines(1);
$builder->setBackgroundColor(255,255,255);
$builder->build();
session(['captcha_phrase' => $builder->getPhrase()]);
header('Content-type: image/jpeg');

View File

@ -250,7 +250,6 @@ body {
float: left;
margin-bottom: 20px;
border-radius: 3px;
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4);
}
#book-appointment-wizard .captcha-text {