mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[feature/auth-refactor] Check that providers implement auth interface
PHPBB3-9734
This commit is contained in:
parent
e674838d69
commit
e2435f25d9
2 changed files with 12 additions and 0 deletions
|
@ -563,6 +563,12 @@ class acp_board
|
||||||
if (array_key_exists('auth.provider.' . $method, $auth_providers))
|
if (array_key_exists('auth.provider.' . $method, $auth_providers))
|
||||||
{
|
{
|
||||||
$provider = $auth_providers['auth.provider.' . $method];
|
$provider = $auth_providers['auth.provider.' . $method];
|
||||||
|
|
||||||
|
if (!($provider instanceof phpbb_auth_provider_interface))
|
||||||
|
{
|
||||||
|
throw new \RuntimeException($provider . ' must implement phpbb_auth_provider_interface');
|
||||||
|
}
|
||||||
|
|
||||||
if ($error = $provider->init())
|
if ($error = $provider->init())
|
||||||
{
|
{
|
||||||
foreach ($old_auth_config as $config_name => $config_value)
|
foreach ($old_auth_config as $config_name => $config_value)
|
||||||
|
|
|
@ -404,6 +404,12 @@ class phpbb_session
|
||||||
$method = basename(trim($config['auth_method']));
|
$method = basename(trim($config['auth_method']));
|
||||||
|
|
||||||
$provider = $phpbb_container->get('auth.provider.' . $method);
|
$provider = $phpbb_container->get('auth.provider.' . $method);
|
||||||
|
|
||||||
|
if (!($provider instanceof phpbb_auth_provider_interface))
|
||||||
|
{
|
||||||
|
throw new \RuntimeException($provider . ' must implement phpbb_auth_provider_interface');
|
||||||
|
}
|
||||||
|
|
||||||
$ret = $provider->validate_session($this->data);
|
$ret = $provider->validate_session($this->data);
|
||||||
if ($ret !== null && !$ret)
|
if ($ret !== null && !$ret)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue