mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API Allow CMS re-authentication to be completely disabled if necessary
This commit is contained in:
parent
f636d15332
commit
31b5a9dc86
@ -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