aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJoseph Warner <hardolaf@hardolaf.com>2013-07-31 14:54:16 -0400
committerJoseph Warner <hardolaf@hardolaf.com>2013-07-31 14:54:28 -0400
commitaa80ac44a4f4f84d0fc41fa0218cc7d7140c3df0 (patch)
tree2645897626d0eb2437b60987a349ae6d66887c73 /phpBB
parent3b19d5c1984c26a137013f0c60a45001321bfa88 (diff)
downloadforums-aa80ac44a4f4f84d0fc41fa0218cc7d7140c3df0.tar
forums-aa80ac44a4f4f84d0fc41fa0218cc7d7140c3df0.tar.gz
forums-aa80ac44a4f4f84d0fc41fa0218cc7d7140c3df0.tar.bz2
forums-aa80ac44a4f4f84d0fc41fa0218cc7d7140c3df0.tar.xz
forums-aa80ac44a4f4f84d0fc41fa0218cc7d7140c3df0.zip
[feature/oauth] Login_link works with ucp_register now
PHPBB3-11673
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/ucp/ucp_register.php28
1 files changed, 21 insertions, 7 deletions
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index d52e172ec2..8400e98630 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -81,6 +81,7 @@ class ucp_register
$cp = new custom_profile();
$error = $cp_data = $cp_error = array();
+ $s_hidden_fields = array();
// Handle login_link data added to $_hidden_fields
$login_link_data = $this->get_login_link_data_array();
@@ -91,13 +92,13 @@ class ucp_register
$auth_provider = 'auth.provider.' . $request->variable('auth_provider', $config['auth_method']);
$auth_provider = $phpbb_container->get($auth_provider);
- $result = $auth_provider->login_link_has_necessary_data($data);
+ $result = $auth_provider->login_link_has_necessary_data($login_link_data);
if ($result !== null)
{
$error[] = $user->lang[$result];
}
- $s_hidden_fields = array_merge($s_hidden_fields, $login_link_data);
+ $s_hidden_fields = array_merge($s_hidden_fields, $this->get_login_link_data_for_hidden_fields($login_link_data));
}
if (!$agreed || ($coppa === false && $config['coppa_enable']) || ($coppa && !$config['coppa_enable']))
@@ -105,9 +106,9 @@ class ucp_register
$add_lang = ($change_lang) ? '&amp;change_lang=' . urlencode($change_lang) : '';
$add_coppa = ($coppa !== false) ? '&amp;coppa=' . $coppa : '';
- $s_hidden_fields = array(
+ $s_hidden_fields = array_merge($s_hidden_fields, array(
'change_lang' => $change_lang,
- );
+ ));
// If we change the language, we want to pass on some more possible parameter.
if ($change_lang)
@@ -433,10 +434,10 @@ class ucp_register
}
}
- $s_hidden_fields = array(
+ $s_hidden_fields = array_merge($s_hidden_fields, array(
'agreed' => 'true',
'change_lang' => 0,
- );
+ ));
if ($config['coppa_enable'])
{
@@ -516,10 +517,23 @@ class ucp_register
{
if (strpos($var_name, 'login_link_') === 0)
{
- $login_link_data[$var_name] = $request->variable($var_name, '', false, phpbb_request_interface::POST);
+ $key_name = str_replace('login_link_', '', $var_name);
+ $login_link_data[$key_name] = $request->variable($var_name, '', false, phpbb_request_interface::POST);
}
}
return $login_link_data;
}
+
+ protected function get_login_link_data_for_hidden_fields($data)
+ {
+ $new_data = array();
+
+ foreach ($data as $key => $value)
+ {
+ $new_data['login_link_' . $key] = $value;
+ }
+
+ return $new_data;
+ }
}