Skip to content

Commit

Permalink
Offer to update Login.php
Browse files Browse the repository at this point in the history
Added displaying captcha on login form if configs set in options
  • Loading branch information
vovanshu authored Mar 6, 2024
1 parent 089f44f commit 9bb36ec
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion application/forms/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')));
}
}

0 comments on commit 9bb36ec

Please sign in to comment.