aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Warner <hardolaf@hardolaf.com>2013-08-12 15:29:08 -0400
committerJoseph Warner <hardolaf@hardolaf.com>2013-08-12 15:29:22 -0400
commit836d3ba22ec997f6c823c9b4594fb42c49524732 (patch)
tree374be02f34b439e0b1e82cdc67744e30c496a0b2
parent4003e077c170e2c9aebbf582cb08249d80d37a3d (diff)
downloadforums-836d3ba22ec997f6c823c9b4594fb42c49524732.tar
forums-836d3ba22ec997f6c823c9b4594fb42c49524732.tar.gz
forums-836d3ba22ec997f6c823c9b4594fb42c49524732.tar.bz2
forums-836d3ba22ec997f6c823c9b4594fb42c49524732.tar.xz
forums-836d3ba22ec997f6c823c9b4594fb42c49524732.zip
[feature/oauth] Handle hidden fields
PHPBB3-11673
-rw-r--r--phpBB/includes/ucp/ucp_auth_link.php13
-rw-r--r--phpBB/phpbb/auth/provider/oauth/oauth.php4
-rw-r--r--phpBB/styles/prosilver/template/ucp_auth_link_oauth.html5
3 files changed, 20 insertions, 2 deletions
diff --git a/phpBB/includes/ucp/ucp_auth_link.php b/phpBB/includes/ucp/ucp_auth_link.php
index 05896f93b0..5b8169e3de 100644
--- a/phpBB/includes/ucp/ucp_auth_link.php
+++ b/phpBB/includes/ucp/ucp_auth_link.php
@@ -54,6 +54,13 @@ class ucp_auth_link
if (isset($provider_data['VARS']))
{
+ // Handle hidden fields separately
+ if (isset($provider_data['VARS']['HIDDEN_FIELDS']))
+ {
+ $s_hidden_fields = array_merge($s_hidden_fields, $provider_data['VARS']['HIDDEN_FIELDS']);
+ unset($provider_data['VARS']['HIDDEN_FIELDS']);
+ }
+
$template->assign_vars($provider_data['VARS']);
}
@@ -61,6 +68,12 @@ class ucp_auth_link
{
foreach ($provider_data['BLOCK_VARS'] as $block_vars)
{
+ // See if there are additional hidden fields. This should be an associative array
+ if (isset($block_vars['HIDDEN_FIELDS']))
+ {
+ $block_vars['HIDDEN_FIELDS'] = build_hidden_fields($block_vars['HIDDEN_FIELDS']);
+ }
+
$template->assign_block_vars($provider_data['BLOCK_VAR_NAME'], $block_vars);
}
}
diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php
index 1b0674a13b..cfffdf2c96 100644
--- a/phpBB/phpbb/auth/provider/oauth/oauth.php
+++ b/phpBB/phpbb/auth/provider/oauth/oauth.php
@@ -481,6 +481,10 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
$redirect_url = build_url(false) . '&login=external&oauth_service=' . $actual_name;
$block_vars[$service_name] = array(
+ 'HIDDEN_FIELDS' => array(
+ 'oauth_service' => $actual_name,
+ ),
+
'REDIRECT_URL' => redirect($redirect_url, true),
'SERVICE_NAME' => $this->user->lang['AUTH_PROVIDER_OAUTH_SERVICE_' . strtoupper($actual_name)],
'UNIQUE_ID' => (isset($oauth_user_ids[$actual_name])) ? $oauth_user_ids[$actual_name] : null,
diff --git a/phpBB/styles/prosilver/template/ucp_auth_link_oauth.html b/phpBB/styles/prosilver/template/ucp_auth_link_oauth.html
index 5950535c80..886aca2aa6 100644
--- a/phpBB/styles/prosilver/template/ucp_auth_link_oauth.html
+++ b/phpBB/styles/prosilver/template/ucp_auth_link_oauth.html
@@ -10,7 +10,7 @@
</dl>
<dl>
<dt>&nbsp;</dt>
- <dd>{S_HIDDEN_FIELDS}<input type="submit" name="unlink" tabindex="6" value="{L_UNLINK}" class="button1" /></dd>
+ <dd><input type="submit" name="unlink" tabindex="6" value="{L_UNLINK}" class="button1" /></dd>
</dl>
<!-- ELSE -->
<dl>
@@ -18,10 +18,11 @@
</dl>
<dl>
<dt>&nbsp;</dt>
- <dd>{S_HIDDEN_FIELDS}<input type="submit" name="link" tabindex="6" value="{L_LINK}" class="button1" /></dd>
+ <dd><input type="submit" name="link" tabindex="6" value="{L_LINK}" class="button1" /></dd>
</dl>
<!-- ENDIF-->
</fieldset>
+ {oauth.HIDDEN_FIELDS}
{S_HIDDEN_FIELDS}
{S_FORM_TOKEN}
</form>