mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #8961 from indygriffiths/patch-1
NEW Only get an authenticator if it's an object
This commit is contained in:
commit
371588e8b1
@ -202,7 +202,7 @@ class Security extends Controller implements TemplateGlobalProvider
|
|||||||
*/
|
*/
|
||||||
public function getAuthenticators()
|
public function getAuthenticators()
|
||||||
{
|
{
|
||||||
return $this->authenticators;
|
return array_filter($this->authenticators);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -244,7 +244,7 @@ class Security extends Controller implements TemplateGlobalProvider
|
|||||||
*/
|
*/
|
||||||
protected function getAuthenticator($name = 'default')
|
protected function getAuthenticator($name = 'default')
|
||||||
{
|
{
|
||||||
$authenticators = $this->authenticators;
|
$authenticators = $this->getAuthenticators();
|
||||||
|
|
||||||
if (isset($authenticators[$name])) {
|
if (isset($authenticators[$name])) {
|
||||||
return $authenticators[$name];
|
return $authenticators[$name];
|
||||||
@ -286,7 +286,7 @@ class Security extends Controller implements TemplateGlobalProvider
|
|||||||
*/
|
*/
|
||||||
public function hasAuthenticator($authenticator)
|
public function hasAuthenticator($authenticator)
|
||||||
{
|
{
|
||||||
$authenticators = $this->authenticators;
|
$authenticators = $this->getAuthenticators();
|
||||||
|
|
||||||
return !empty($authenticators[$authenticator]);
|
return !empty($authenticators[$authenticator]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user