aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJoseph Warner <hardolaf@hardolaf.com>2013-07-22 16:23:13 -0400
committerJoseph Warner <hardolaf@hardolaf.com>2013-07-22 16:23:41 -0400
commitcd49cfacfb0faddce8343837b69eb919b8652352 (patch)
tree52614c152448ee1eb9a6a77b9f30fe0aad14fe03 /phpBB
parentd804842cef945dbc7ec2c6c1d145587c62f06f65 (diff)
downloadforums-cd49cfacfb0faddce8343837b69eb919b8652352.tar
forums-cd49cfacfb0faddce8343837b69eb919b8652352.tar.gz
forums-cd49cfacfb0faddce8343837b69eb919b8652352.tar.bz2
forums-cd49cfacfb0faddce8343837b69eb919b8652352.tar.xz
forums-cd49cfacfb0faddce8343837b69eb919b8652352.zip
[feature/oauth] Initial step in creating OAuth login support
PHPBB3-11673
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions.php12
-rw-r--r--phpBB/phpbb/auth/provider/oauth/oauth.php10
-rw-r--r--phpBB/styles/prosilver/template/login_body.html6
3 files changed, 26 insertions, 2 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 49f2e469bc..1bb9cc8299 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -3199,7 +3199,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = false, $s_display = true)
{
global $db, $user, $template, $auth, $phpEx, $phpbb_root_path, $config;
- global $request;
+ global $request, $phpbb_container;
if (!class_exists('phpbb_captcha_factory', false))
{
@@ -3367,12 +3367,22 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
$s_hidden_fields['credential'] = $credential;
}
+ $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();
+ }
+
$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 7f3de0f4d9..eeb4b23be4 100644
--- a/phpBB/phpbb/auth/provider/oauth/oauth.php
+++ b/phpBB/phpbb/auth/provider/oauth/oauth.php
@@ -230,4 +230,14 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
$service_factory = new \OAuth\ServiceFactory();
return $service_factory->createService($service_name, $credentials, $storage, $scopes);
}
+
+ /**
+ * Returns an array of login data for all enabled OAuth services.
+ *
+ * @return array
+ */
+ public function get_login_data()
+ {
+ return array();
+ }
}
diff --git a/phpBB/styles/prosilver/template/login_body.html b/phpBB/styles/prosilver/template/login_body.html
index 89ef8acd6f..4a51cf477f 100644
--- a/phpBB/styles/prosilver/template/login_body.html
+++ b/phpBB/styles/prosilver/template/login_body.html
@@ -46,7 +46,11 @@
<dd>{S_HIDDEN_FIELDS}<input type="submit" name="login" tabindex="6" value="{L_LOGIN}" class="button1" /></dd>
</dl>
</fieldset>
- </div>
+ </div><!-- IF OAUTH_LOGIN -->
+
+ <div class="content">
+ hi
+ </div><!-- ENDIF -->
</div>
</div>