1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-13 04:04:12 +02:00

[feature/auth-refactor] Refactor code to use services

Refactors all loading of auth providers to use services instead of
directly calling the class.

PHPBB3-9734
This commit is contained in:
Joseph Warner
2013-06-21 18:04:11 -04:00
parent 95f38b457e
commit b8610c4b98
3 changed files with 24 additions and 40 deletions

View File

@@ -546,10 +546,9 @@ class acp_board
{
if ($method)
{
$class = 'phpbb_auth_provider_' . $method;
if (class_exists($class))
$provider = $phpbb_container->get('auth.provider.' . $method);
if ($provider)
{
$provider = new $class();
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
@@ -586,10 +585,9 @@ class acp_board
$method = basename($cfg_array['auth_method']);
if ($method)
{
$class = 'phpbb_auth_provider_' . $method;
if (class_exists($class))
$provider = $phpbb_container->get('auth.provider.' . $method);
if ($provider)
{
$provider = new $class();
if ($error = $provider->init())
{
foreach ($old_auth_config as $config_name => $config_value)
@@ -685,10 +683,9 @@ class acp_board
{
if ($method)
{
$class = 'phpbb_auth_provider_' . $method;
if (class_exists($class))
$provider = $phpbb_container->get('auth.provider.' . $method);
if ($provider)
{
$provider = new $class();
$fields = $provider->acp($this->new_config);
if ($fields['tpl'])