From 605aa71de51b21cc2b4d61a2e32646c9aff1e651 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Wed, 6 Mar 2024 11:41:46 +0200 Subject: [PATCH] Offer for update Login.php Added displaying captcha on login form if it configured --- application/forms/Login.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/application/forms/Login.php b/application/forms/Login.php index e8d9dda5a..d2d18cdf2 100644 --- a/application/forms/Login.php +++ b/application/forms/Login.php @@ -50,7 +50,18 @@ public function init() 'label' => __('Remember Me?'), 'decorators' => $decorators, )); - $this->addDisplayGroup(array('username', 'password', 'remember'), 'login'); + if(Omeka_Captcha::isConfigured()) { + $this->addElement('captcha', 'captcha', array( + 'class' => 'hidden', + 'style' => 'display: none;', + 'label' => __("Please verify you're a human"), + 'type' => 'hidden', + 'captcha' => Omeka_Captcha::getCaptcha() + )); + $this->addDisplayGroup(array('username', 'password','captcha', 'remember'), 'login'); + }else{ + $this->addDisplayGroup(array('username', 'password', 'remember'), 'login'); + } $this->addElement('submit', 'submit', array('label' => __('Log In'))); } }