mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-08-22 02:26:11 +02:00
Merge pull request #3665 from tractorcow/pulls/3.1/disable-auth
API Allow CMS re-authentication to be completely disabled if necessary
This commit is contained in:
commit
f270dbcad6
@ -14,6 +14,14 @@ class CMSSecurity extends Security {
|
|||||||
'success'
|
'success'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable in-cms reauthentication
|
||||||
|
*
|
||||||
|
* @var boolean
|
||||||
|
* @config
|
||||||
|
*/
|
||||||
|
private static $reauth_enabled = true;
|
||||||
|
|
||||||
public function init() {
|
public function init() {
|
||||||
parent::init();
|
parent::init();
|
||||||
|
|
||||||
@ -140,6 +148,9 @@ PHP
|
|||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function enabled() {
|
public static function enabled() {
|
||||||
|
// Disable shortcut
|
||||||
|
if(!static::config()->reauth_enabled) return false;
|
||||||
|
|
||||||
// Count all cms-supported methods
|
// Count all cms-supported methods
|
||||||
$authenticators = Authenticator::get_authenticators();
|
$authenticators = Authenticator::get_authenticators();
|
||||||
foreach($authenticators as $authenticator) {
|
foreach($authenticators as $authenticator) {
|
||||||
|
Loading…
Reference in New Issue
Block a user