1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 12:03:21 +01:00

[feature/oauth] Handle hidden fields

PHPBB3-11673
This commit is contained in:
Joseph Warner 2013-08-12 15:29:08 -04:00
parent 4003e077c1
commit 836d3ba22e
3 changed files with 20 additions and 2 deletions

View File

@ -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);
}
}

View File

@ -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,

View File

@ -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>