mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fix for CMS Authenticator. Should only apply to CMSSecurity
This commit is contained in:
parent
c7f7233c4d
commit
3fe837dad7
@ -31,5 +31,8 @@ SilverStripe\Core\Injector\Injector:
|
||||
properties:
|
||||
Authenticators:
|
||||
default: %$SilverStripe\Security\MemberAuthenticator\MemberAuthenticator
|
||||
SilverStripe\Security\CMSSecurity:
|
||||
properties:
|
||||
Authenticators:
|
||||
cms: %$SilverStripe\Security\MemberAuthenticator\CMSMemberAuthenticator
|
||||
SilverStripe\Security\IdentityStore: %$SilverStripe\Security\AuthenticationHandler
|
||||
|
@ -165,14 +165,14 @@ PHP
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function enabled()
|
||||
public function enabled()
|
||||
{
|
||||
// Disable shortcut
|
||||
if (!static::config()->get('reauth_enabled')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return count(Security::singleton()->getApplicableAuthenticators(Authenticator::CMS_LOGIN)) > 0;
|
||||
return count($this->getApplicableAuthenticators(Authenticator::CMS_LOGIN)) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -356,7 +356,7 @@ class Security extends Controller implements TemplateGlobalProvider
|
||||
_t('SilverStripe\\CMS\\Controllers\\ContentController.NOTLOGGEDIN', 'Not logged in')
|
||||
);
|
||||
// Tell the CMS to allow re-authentication
|
||||
if (CMSSecurity::enabled()) {
|
||||
if (CMSSecurity::singleton()->enabled()) {
|
||||
$response->addHeader('X-Reauthenticate', '1');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user