mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-25 19:38:53 +00:00
[feature/auth-refactor] Refactor auth in acp_board
Changes the acp_board code to directly call the auth providers out of the $auth_providers variable that is populated by the phpbb_container. PHPBB3-9734
This commit is contained in:
parent
b78b6711c8
commit
3c394aee62
1 changed files with 3 additions and 22 deletions
|
@ -525,20 +525,10 @@ class acp_board
|
|||
$auth_plugins = array();
|
||||
$auth_providers = $phpbb_container->get('auth.provider_collection');
|
||||
|
||||
foreach($auth_providers as $key => $value)
|
||||
{
|
||||
$auth_plugins[] = $key;
|
||||
}
|
||||
|
||||
$updated_auth_settings = false;
|
||||
$old_auth_config = array();
|
||||
foreach ($auth_plugins as $method)
|
||||
foreach ($auth_providers as $provider)
|
||||
{
|
||||
if ($method)
|
||||
{
|
||||
$provider = $auth_providers[$method];
|
||||
if ($provider)
|
||||
{
|
||||
if ($fields = $provider->acp($this->new_config))
|
||||
{
|
||||
// Check if we need to create config fields for this plugin and save config when submit was pressed
|
||||
|
@ -566,8 +556,6 @@ class acp_board
|
|||
}
|
||||
}
|
||||
unset($fields);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($submit && (($cfg_array['auth_method'] != $this->new_config['auth_method']) || $updated_auth_settings))
|
||||
|
@ -575,7 +563,7 @@ class acp_board
|
|||
$method = basename($cfg_array['auth_method']);
|
||||
if ($method)
|
||||
{
|
||||
$provider = $auth_providers[$method];
|
||||
$provider = $auth_providers['auth.provider.' . $method];
|
||||
if ($provider)
|
||||
{
|
||||
if ($error = $provider->init())
|
||||
|
@ -669,13 +657,8 @@ class acp_board
|
|||
{
|
||||
$template->assign_var('S_AUTH', true);
|
||||
|
||||
foreach ($auth_plugins as $method)
|
||||
foreach ($auth_provider as $provider)
|
||||
{
|
||||
if ($method)
|
||||
{
|
||||
$provider = $auth_providers[$method];
|
||||
if ($provider)
|
||||
{
|
||||
$fields = $provider->acp($this->new_config);
|
||||
|
||||
if ($fields['tpl'])
|
||||
|
@ -685,8 +668,6 @@ class acp_board
|
|||
);
|
||||
}
|
||||
unset($fields);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue