mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-10-22 11:05:46 +02:00
IMPR: Allow to disable login form captcha
This commit is contained in:
parent
3ef97b0567
commit
5efdcfb0e5
@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
namespace A2nt\CMSNiceties\Extensions;
|
namespace A2nt\CMSNiceties\Extensions;
|
||||||
|
|
||||||
|
|
||||||
use SilverStripe\Control\Director;
|
use SilverStripe\Control\Director;
|
||||||
use SilverStripe\Security\MemberAuthenticator\MemberLoginForm;
|
use SilverStripe\Security\MemberAuthenticator\MemberLoginForm;
|
||||||
|
|
||||||
class SiteMemberLoginForm extends MemberLoginForm
|
class SiteMemberLoginForm extends MemberLoginForm
|
||||||
{
|
{
|
||||||
|
private static $enable_captcha = true;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
$controller,
|
$controller,
|
||||||
$authenticatorClass,
|
$authenticatorClass,
|
||||||
@ -44,7 +44,7 @@ class SiteMemberLoginForm extends MemberLoginForm
|
|||||||
$btn->addExtraClass('btn-lg');
|
$btn->addExtraClass('btn-lg');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Director::isLive()) {
|
if (self::config()->get('enable_captcha') && Director::isLive()) {
|
||||||
$this->enableSpamProtection();
|
$this->enableSpamProtection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user