mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 22:08:54 +00:00
[feature/oauth] Pass users_table as parameter to OAuth in construct
PHPBB3-11673
This commit is contained in:
parent
e16dd958e3
commit
3cbb973160
2 changed files with 12 additions and 2 deletions
|
@ -45,6 +45,7 @@ services:
|
||||||
- %tables.auth_provider_oauth_token_storage%
|
- %tables.auth_provider_oauth_token_storage%
|
||||||
- %tables.auth_provider_oauth_account_assoc%
|
- %tables.auth_provider_oauth_account_assoc%
|
||||||
- @auth.provider.oauth.service_collection
|
- @auth.provider.oauth.service_collection
|
||||||
|
- %tables.users%
|
||||||
tags:
|
tags:
|
||||||
- { name: auth.provider }
|
- { name: auth.provider }
|
||||||
auth.provider.oauth.service_collection:
|
auth.provider.oauth.service_collection:
|
||||||
|
|
|
@ -74,6 +74,13 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
|
||||||
*/
|
*/
|
||||||
protected $service_providers;
|
protected $service_providers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Users table
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $users_table;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cached current uri object
|
* Cached current uri object
|
||||||
*
|
*
|
||||||
|
@ -91,8 +98,9 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
|
||||||
* @param string $auth_provider_oauth_token_storage_table
|
* @param string $auth_provider_oauth_token_storage_table
|
||||||
* @param string $auth_provider_oauth_token_account_assoc
|
* @param string $auth_provider_oauth_token_account_assoc
|
||||||
* @param phpbb_di_service_collection $service_providers Contains phpbb_auth_provider_oauth_service_interface
|
* @param phpbb_di_service_collection $service_providers Contains phpbb_auth_provider_oauth_service_interface
|
||||||
|
* @param string $users)table
|
||||||
*/
|
*/
|
||||||
public function __construct(phpbb_db_driver $db, phpbb_config $config, phpbb_request $request, phpbb_user $user, $auth_provider_oauth_token_storage_table, $auth_provider_oauth_token_account_assoc, phpbb_di_service_collection $service_providers)
|
public function __construct(phpbb_db_driver $db, phpbb_config $config, phpbb_request $request, phpbb_user $user, $auth_provider_oauth_token_storage_table, $auth_provider_oauth_token_account_assoc, phpbb_di_service_collection $service_providers, $users_table)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
|
@ -101,6 +109,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
|
||||||
$this->auth_provider_oauth_token_storage_table = $auth_provider_oauth_token_storage_table;
|
$this->auth_provider_oauth_token_storage_table = $auth_provider_oauth_token_storage_table;
|
||||||
$this->auth_provider_oauth_token_account_assoc = $auth_provider_oauth_token_account_assoc;
|
$this->auth_provider_oauth_token_account_assoc = $auth_provider_oauth_token_account_assoc;
|
||||||
$this->service_providers = $service_providers;
|
$this->service_providers = $service_providers;
|
||||||
|
$this->users_table = $users_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -184,7 +193,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
|
||||||
|
|
||||||
// Retrieve the user's account
|
// Retrieve the user's account
|
||||||
$sql = 'SELECT user_id, username, user_password, user_passchg, user_pass_convert, user_email, user_type, user_login_attempts
|
$sql = 'SELECT user_id, username, user_password, user_passchg, user_pass_convert, user_email, user_type, user_login_attempts
|
||||||
FROM ' . USERS_TABLE . "
|
FROM ' . $this->users_table . "
|
||||||
WHERE user_id = '" . $this->db->sql_escape($row['user_id']) . "'";
|
WHERE user_id = '" . $this->db->sql_escape($row['user_id']) . "'";
|
||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
$row = $this->db->sql_fetchrow($result);
|
$row = $this->db->sql_fetchrow($result);
|
||||||
|
|
Loading…
Add table
Reference in a new issue