1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +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

@@ -927,14 +927,13 @@ class phpbb_auth
*/
function login($username, $password, $autologin = false, $viewonline = 1, $admin = 0)
{
global $config, $db, $user, $phpbb_root_path, $phpEx;
global $config, $db, $user, $phpbb_root_path, $phpEx, $phpbb_container;
$method = trim(basename($config['auth_method']));
$class = 'phpbb_auth_provider_' . $method;
if (class_exists($class))
$provider = $phpbb_container->get('auth.provider.' . $method);
if ($provider)
{
$provider = new $class();
$login = $provider->login($username, $password);
// If the auth module wants us to create an empty profile do so and then treat the status as LOGIN_SUCCESS