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:
Sean Harvey 2014-11-24 09:21:31 +13:00
commit f270dbcad6

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) {