API Allow CMS re-authentication to be completely disabled if necessary

This commit is contained in:
Damian Mooyman 2014-11-21 17:40:39 +13:00
parent f636d15332
commit 31b5a9dc86

View File

@ -14,6 +14,14 @@ class CMSSecurity extends Security {
'success'
);
/**
* Enable in-cms reauthentication
*
* @var boolean
* @config
*/
private static $reauth_enabled = true;
public function init() {
parent::init();
@ -140,6 +148,9 @@ PHP
* @return bool
*/
public static function enabled() {
// Disable shortcut
if(!static::config()->reauth_enabled) return false;
// Count all cms-supported methods
$authenticators = Authenticator::get_authenticators();
foreach($authenticators as $authenticator) {