aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/includes/functions.php19
-rw-r--r--phpBB/phpbb/auth/provider/oauth/oauth.php8
-rw-r--r--phpBB/styles/prosilver/template/login_body.html13
-rw-r--r--phpBB/styles/prosilver/template/login_body_oauth.html8
4 files changed, 22 insertions, 26 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 79391aba56..5849a21013 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -3379,7 +3379,10 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
if (isset($auth_provider_data['BLOCK_VAR_NAME']))
{
- $template->assign_block_vars($auth_provider_data['BLOCK_VAR_NAME'], $auth_provider_data['BLOCK_VARS']);
+ foreach ($auth_provider_data['BLOCK_VARS'] as $block_vars)
+ {
+ $template->assign_block_vars($auth_provider_data['BLOCK_VAR_NAME'], $block_vars);
+ }
}
$template->assign_vars(array(
@@ -3387,26 +3390,12 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
));
}
- $oauth_login = ($config['auth_method'] == 'oauth') ? true : false;
-
- if ($oauth_login)
- {
- $auth_provider = $phpbb_container->get('auth.provider.oauth');
- $oauth_box_data = $auth_provider->get_login_data();
- foreach ($oauth_box_data as $data)
- {
- $template->assign_block_vars('oauth', $data);
- }
- }
-
$s_hidden_fields = build_hidden_fields($s_hidden_fields);
$template->assign_vars(array(
'LOGIN_ERROR' => $err,
'LOGIN_EXPLAIN' => $l_explain,
- 'OAUTH_LOGIN' => $oauth_login,
-
'U_SEND_PASSWORD' => ($config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') : '',
'U_RESEND_ACTIVATION' => ($config['require_activation'] == USER_ACTIVATION_SELF && $config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=resend_act') : '',
'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php
index 62024ff094..1cc19d143e 100644
--- a/phpBB/phpbb/auth/provider/oauth/oauth.php
+++ b/phpBB/phpbb/auth/provider/oauth/oauth.php
@@ -278,7 +278,11 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
*/
public function get_login_data()
{
- $login_data = array();
+ $login_data = array(
+ 'TEMPLATE_FILE' => 'login_body_oauth.html',
+ 'BLOCK_VAR_NAME' => 'oauth',
+ 'BLOCK_VARS' => array(),
+ );
foreach ($this->service_providers as $service_name => $service_provider)
{
@@ -288,7 +292,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
{
$actual_name = str_replace('auth.provider.oauth.service.', '', $service_name);
$redirect_url = build_url(false) . '&login=external&oauth_service=' . $actual_name;
- $login_data[$service_name] = array(
+ $login_data['BLOCK_VARS'][$service_name] = array(
'REDIRECT_URL' => redirect($redirect_url, true),
'SERVICE_NAME' => $this->user->lang['AUTH_PROVIDER_OAUTH_SERVICE_' . strtoupper($actual_name)],
);
diff --git a/phpBB/styles/prosilver/template/login_body.html b/phpBB/styles/prosilver/template/login_body.html
index 64b3915a1b..e00e5d7a67 100644
--- a/phpBB/styles/prosilver/template/login_body.html
+++ b/phpBB/styles/prosilver/template/login_body.html
@@ -46,16 +46,11 @@
<dd>{S_HIDDEN_FIELDS}<input type="submit" name="login" tabindex="6" value="{L_LOGIN}" class="button1" /></dd>
</dl>
</fieldset>
- </div><!-- IF OAUTH_LOGIN -->
+ </div>
- <div class="content">
- <!-- BEGIN oauth -->
- <dl>
- <dt>&nbsp;</dt>
- <dd><a href="{oauth.REDIRECT_URL}" class="button2">{oauth.SERVICE_NAME}</a></dd>
- </dl>
- <!-- END oauth -->
- </div><!-- ENDIF -->
+ <!-- IF PROVIDER_TEMPLATE_FILE -->
+ <!-- INCLUDE {PROVIDER_TEMPLATE_FILE} -->
+ <!-- ENDIF -->
</div>
</div>
diff --git a/phpBB/styles/prosilver/template/login_body_oauth.html b/phpBB/styles/prosilver/template/login_body_oauth.html
new file mode 100644
index 0000000000..eb6c627c6f
--- /dev/null
+++ b/phpBB/styles/prosilver/template/login_body_oauth.html
@@ -0,0 +1,8 @@
+<div class="content">
+ <!-- BEGIN oauth -->
+ <dl>
+ <dt>&nbsp;</dt>
+ <dd><a href="{oauth.REDIRECT_URL}" class="button2">{oauth.SERVICE_NAME}</a></dd>
+ </dl>
+<!-- END oauth -->
+</div> \ No newline at end of file