Skip to content

Commit e398008

Browse files
committed
[ticket/11838] OAuth registration from ucp_register
PHPBB3-11838
1 parent 911c46c commit e398008

4 files changed

Lines changed: 38 additions & 1 deletion

File tree

phpBB/includes/ucp/ucp_register.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,31 @@ function main($id, $mode)
549549
break;
550550
}
551551

552+
/* @var $provider_collection \phpbb\auth\provider_collection */
553+
$provider_collection = $phpbb_container->get('auth.provider_collection');
554+
$auth_provider = $provider_collection->get_provider();
555+
556+
$auth_provider_data = $auth_provider->get_login_data();
557+
if ($auth_provider_data)
558+
{
559+
if (isset($auth_provider_data['VARS']))
560+
{
561+
$template->assign_vars($auth_provider_data['VARS']);
562+
}
563+
564+
if (isset($auth_provider_data['BLOCK_VAR_NAME']))
565+
{
566+
foreach ($auth_provider_data['BLOCK_VARS'] as $block_vars)
567+
{
568+
$template->assign_block_vars($auth_provider_data['BLOCK_VAR_NAME'], $block_vars);
569+
}
570+
}
571+
572+
$template->assign_vars(array(
573+
'PROVIDER_TEMPLATE_FILE' => $auth_provider_data['TEMPLATE_FILE'],
574+
));
575+
}
576+
552577
// Assign template vars for timezone select
553578
phpbb_timezone_select($template, $user, $data['tz'], true);
554579

phpBB/language/en/ucp.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@
446446
'RECIPIENT' => 'Recipient',
447447
'RECIPIENTS' => 'Recipients',
448448
'REGISTRATION' => 'Registration',
449+
'OAUTH_REGISTRATION' => 'Registration using external services',
449450
'RELEASE_MESSAGES' => '%sRelease all on-hold messages%s… they will be re-sorted into the appropriate folder if enough space is made available.',
450451
'REMOVE_ADDRESS' => 'Remove address',
451452
'REMOVE_SELECTED_BOOKMARKS' => 'Remove selected bookmarks',

phpBB/phpbb/auth/provider/oauth/oauth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ public function get_login_data()
392392
if ($credentials['key'] && $credentials['secret'])
393393
{
394394
$actual_name = str_replace('auth.provider.oauth.service.', '', $service_name);
395-
$redirect_url = build_url(false) . '&login=external&oauth_service=' . $actual_name;
395+
$redirect_url = generate_board_url() . '/ucp.' . $this->php_ext . '?mode=login&login=external&oauth_service=' . $actual_name;
396396
$login_data['BLOCK_VARS'][$service_name] = array(
397397
'REDIRECT_URL' => redirect($redirect_url, true),
398398
'SERVICE_NAME' => $this->user->lang['AUTH_PROVIDER_OAUTH_SERVICE_' . strtoupper($actual_name)],

phpBB/styles/prosilver/template/ucp_register.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@
1212
}
1313
</script>
1414

15+
<div class="panel">
16+
<div class="inner">
17+
18+
<h2>{{ SITENAME }} - {{ lang('OAUTH_REGISTRATION') }}</h2>
19+
20+
{% if PROVIDER_TEMPLATE_FILE %}
21+
{% include PROVIDER_TEMPLATE_FILE %}
22+
{% endif %}
23+
</div>
24+
</div>
25+
1526
<form id="register" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>
1627

1728
<div class="panel">

0 commit comments

Comments
 (0)