mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[feature/oauth] Fix redirects
PHPBB3-11673
This commit is contained in:
parent
76d1e7e111
commit
310caec5d9
3 changed files with 25 additions and 8 deletions
|
@ -46,6 +46,8 @@ services:
|
||||||
- %tables.auth_provider_oauth_account_assoc%
|
- %tables.auth_provider_oauth_account_assoc%
|
||||||
- @auth.provider.oauth.service_collection
|
- @auth.provider.oauth.service_collection
|
||||||
- %tables.users%
|
- %tables.users%
|
||||||
|
- %core.root_path%
|
||||||
|
- %core.php_ext%
|
||||||
tags:
|
tags:
|
||||||
- { name: auth.provider }
|
- { name: auth.provider }
|
||||||
auth.provider.oauth.service_collection:
|
auth.provider.oauth.service_collection:
|
||||||
|
|
|
@ -975,12 +975,9 @@ class phpbb_auth
|
||||||
{
|
{
|
||||||
// If this status exists a fourth field is in the $login array called 'redirect_data'
|
// If this status exists a fourth field is in the $login array called 'redirect_data'
|
||||||
// This data is passed along as GET data to the next page allow the account to be linked
|
// This data is passed along as GET data to the next page allow the account to be linked
|
||||||
$url = 'ucp.php?mode=login_link';
|
|
||||||
|
|
||||||
foreach ($login['redirect_data'] as $key => $value)
|
$params = array('mode' => 'login_link');
|
||||||
{
|
$url = append_sid('ucp.' . $phpEx, array_merge($params, $login['redirect_data']));
|
||||||
$url .= '&' . $key . '=' . $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
redirect($url);
|
redirect($url);
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,20 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
|
||||||
*/
|
*/
|
||||||
protected $current_uri;
|
protected $current_uri;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* phpBB root path
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $phpbb_root_path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP extenstion
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $php_ext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OAuth Authentication Constructor
|
* OAuth Authentication Constructor
|
||||||
*
|
*
|
||||||
|
@ -98,9 +112,11 @@ 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
|
* @param string $users_table
|
||||||
|
* @param string $phpbb_root_path
|
||||||
|
* @param string $php_ext
|
||||||
*/
|
*/
|
||||||
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)
|
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, $phpbb_root_path, $php_ext)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
|
@ -110,6 +126,8 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
|
||||||
$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;
|
$this->users_table = $users_table;
|
||||||
|
$this->phpbb_root_path = $phpbb_root_path;
|
||||||
|
$this->php_ext = $php_ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -138,7 +156,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
|
||||||
// Temporary workaround for only having one authentication provider available
|
// Temporary workaround for only having one authentication provider available
|
||||||
if (!$this->request->is_set('oauth_service'))
|
if (!$this->request->is_set('oauth_service'))
|
||||||
{
|
{
|
||||||
$provider = new phpbb_auth_provider_db($this->db, $this->config, $this->request, $this->user, $phpbb_root_path, $phpEx);
|
$provider = new phpbb_auth_provider_db($this->db, $this->config, $this->request, $this->user, $this->phpbb_root_path, $this->php_ext);
|
||||||
return $provider->login($username, $password);
|
return $provider->login($username, $password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue