aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Warner <hardolaf@hardolaf.com>2013-08-24 21:34:23 -0400
committerJoseph Warner <hardolaf@hardolaf.com>2013-08-24 21:34:37 -0400
commit310caec5d92d58453d1eee40e9b5a7f0157bd5ea (patch)
tree90099bf832f355a7e6f41810926010babb88c5b9
parent76d1e7e111d4a12f50e3c4776b00a6681a83b295 (diff)
downloadforums-310caec5d92d58453d1eee40e9b5a7f0157bd5ea.tar
forums-310caec5d92d58453d1eee40e9b5a7f0157bd5ea.tar.gz
forums-310caec5d92d58453d1eee40e9b5a7f0157bd5ea.tar.bz2
forums-310caec5d92d58453d1eee40e9b5a7f0157bd5ea.tar.xz
forums-310caec5d92d58453d1eee40e9b5a7f0157bd5ea.zip
[feature/oauth] Fix redirects
PHPBB3-11673
-rw-r--r--phpBB/config/auth_providers.yml2
-rw-r--r--phpBB/phpbb/auth/auth.php7
-rw-r--r--phpBB/phpbb/auth/provider/oauth/oauth.php24
3 files changed, 25 insertions, 8 deletions
diff --git a/phpBB/config/auth_providers.yml b/phpBB/config/auth_providers.yml
index bad6be9880..dfa229fa42 100644
--- a/phpBB/config/auth_providers.yml
+++ b/phpBB/config/auth_providers.yml
@@ -46,6 +46,8 @@ services:
- %tables.auth_provider_oauth_account_assoc%
- @auth.provider.oauth.service_collection
- %tables.users%
+ - %core.root_path%
+ - %core.php_ext%
tags:
- { name: auth.provider }
auth.provider.oauth.service_collection:
diff --git a/phpBB/phpbb/auth/auth.php b/phpBB/phpbb/auth/auth.php
index 400f5fef6d..5093483d4a 100644
--- a/phpBB/phpbb/auth/auth.php
+++ b/phpBB/phpbb/auth/auth.php
@@ -975,12 +975,9 @@ class phpbb_auth
{
// 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
- $url = 'ucp.php?mode=login_link';
- foreach ($login['redirect_data'] as $key => $value)
- {
- $url .= '&' . $key . '=' . $value;
- }
+ $params = array('mode' => 'login_link');
+ $url = append_sid('ucp.' . $phpEx, array_merge($params, $login['redirect_data']));
redirect($url);
}
diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php
index e1172f2e70..b427ca4e72 100644
--- a/phpBB/phpbb/auth/provider/oauth/oauth.php
+++ b/phpBB/phpbb/auth/provider/oauth/oauth.php
@@ -89,6 +89,20 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
protected $current_uri;
/**
+ * phpBB root path
+ *
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * PHP extenstion
+ *
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
* OAuth Authentication Constructor
*
* @param phpbb_db_driver $db
@@ -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_account_assoc
* @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->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->service_providers = $service_providers;
$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
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);
}