aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2014-08-16 09:50:51 +0200
committerAndreas Fischer <bantu@phpbb.com>2014-08-16 09:50:51 +0200
commite9f5b9d657b92f6d53d76c28ba4de64722700e7e (patch)
tree64035f3eaedcd405e258ea2aa164db7b6123f47c
parentad625c1e6d5e3aff39a3cd95a7d20ac84a19dbca (diff)
parente31aafb393fe74d69a72987608b71a9232295a05 (diff)
downloadforums-e9f5b9d657b92f6d53d76c28ba4de64722700e7e.tar
forums-e9f5b9d657b92f6d53d76c28ba4de64722700e7e.tar.gz
forums-e9f5b9d657b92f6d53d76c28ba4de64722700e7e.tar.bz2
forums-e9f5b9d657b92f6d53d76c28ba4de64722700e7e.tar.xz
forums-e9f5b9d657b92f6d53d76c28ba4de64722700e7e.zip
Merge pull request #2872 from Nicofuma/ticket/12975
[ticket/12975] Fix the construction of phpbb\auth\provider\db for Oauth * Nicofuma/ticket/12975: [ticket/12975] Fix the construction of phpbb\auth\provider\db for Oauth
-rw-r--r--phpBB/config/auth_providers.yml1
-rw-r--r--phpBB/phpbb/auth/provider/oauth/oauth.php13
2 files changed, 12 insertions, 2 deletions
diff --git a/phpBB/config/auth_providers.yml b/phpBB/config/auth_providers.yml
index db7c603bcd..89303a684a 100644
--- a/phpBB/config/auth_providers.yml
+++ b/phpBB/config/auth_providers.yml
@@ -52,6 +52,7 @@ services:
- %tables.auth_provider_oauth_account_assoc%
- @auth.provider.oauth.service_collection
- %tables.users%
+ - @service_container
- %core.root_path%
- %core.php_ext%
tags:
diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php
index 7b71e3c844..902c6ae84c 100644
--- a/phpBB/phpbb/auth/provider/oauth/oauth.php
+++ b/phpBB/phpbb/auth/provider/oauth/oauth.php
@@ -91,6 +91,13 @@ class oauth extends \phpbb\auth\provider\base
protected $current_uri;
/**
+ * DI container
+ *
+ * @var \Symfony\Component\DependencyInjection\ContainerInterface
+ */
+ protected $phpbb_container;
+
+ /**
* phpBB root path
*
* @var string
@@ -116,10 +123,11 @@ class oauth extends \phpbb\auth\provider\base
* @param string $auth_provider_oauth_token_account_assoc
* @param \phpbb\di\service_collection $service_providers Contains \phpbb\auth\provider\oauth\service_interface
* @param string $users_table
+ * @param \Symfony\Component\DependencyInjection\ContainerInterface $phpbb_container DI container
* @param string $phpbb_root_path
* @param string $php_ext
*/
- public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\passwords\manager $passwords_manager, \phpbb\request\request_interface $request, \phpbb\user $user, $auth_provider_oauth_token_storage_table, $auth_provider_oauth_token_account_assoc, \phpbb\di\service_collection $service_providers, $users_table, $phpbb_root_path, $php_ext)
+ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\passwords\manager $passwords_manager, \phpbb\request\request_interface $request, \phpbb\user $user, $auth_provider_oauth_token_storage_table, $auth_provider_oauth_token_account_assoc, \phpbb\di\service_collection $service_providers, $users_table, \Symfony\Component\DependencyInjection\ContainerInterface $phpbb_container, $phpbb_root_path, $php_ext)
{
$this->db = $db;
$this->config = $config;
@@ -130,6 +138,7 @@ class oauth extends \phpbb\auth\provider\base
$this->auth_provider_oauth_token_account_assoc = $auth_provider_oauth_token_account_assoc;
$this->service_providers = $service_providers;
$this->users_table = $users_table;
+ $this->phpbb_container = $phpbb_container;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
}
@@ -160,7 +169,7 @@ class oauth extends \phpbb\auth\provider\base
// Temporary workaround for only having one authentication provider available
if (!$this->request->is_set('oauth_service'))
{
- $provider = new \phpbb\auth\provider\db($this->db, $this->config, $this->passwords_manager, $this->request, $this->user, $this->phpbb_root_path, $this->php_ext);
+ $provider = new \phpbb\auth\provider\db($this->db, $this->config, $this->passwords_manager, $this->request, $this->user, $this->phpbb_container, $this->phpbb_root_path, $this->php_ext);
return $provider->login($username, $password);
}