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:
@@ -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
|
||||
|
Reference in New Issue
Block a user