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'); $captcha_phrase = session('captcha_phrase');
// Validate the CAPTCHA string. // Validate the CAPTCHA string.
if ($require_captcha && $captcha_phrase !== $captcha) if ($require_captcha && strtoupper($captcha_phrase) !== strtoupper($captcha))
{ {
json_response([ json_response([
'captcha_verification' => FALSE 'captcha_verification' => FALSE

View file

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

View file

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