aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Warner <hardolaf@hardolaf.com>2013-07-22 16:35:18 -0400
committerJoseph Warner <hardolaf@hardolaf.com>2013-07-22 16:36:42 -0400
commit0be81468e7f61b8c2fc1c9729ff5d217c7424026 (patch)
tree8f37a8e5f141467e53e1bc641035dd546e7ef654
parentcd49cfacfb0faddce8343837b69eb919b8652352 (diff)
downloadforums-0be81468e7f61b8c2fc1c9729ff5d217c7424026.tar
forums-0be81468e7f61b8c2fc1c9729ff5d217c7424026.tar.gz
forums-0be81468e7f61b8c2fc1c9729ff5d217c7424026.tar.bz2
forums-0be81468e7f61b8c2fc1c9729ff5d217c7424026.tar.xz
forums-0be81468e7f61b8c2fc1c9729ff5d217c7424026.zip
[feature/oauth] Possible way of getting the login data to login_box()
PHPBB3-11673
-rw-r--r--phpBB/phpbb/auth/provider/oauth/oauth.php18
-rw-r--r--phpBB/styles/prosilver/template/login_body.html2
2 files changed, 18 insertions, 2 deletions
diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php
index eeb4b23be4..e43579a740 100644
--- a/phpBB/phpbb/auth/provider/oauth/oauth.php
+++ b/phpBB/phpbb/auth/provider/oauth/oauth.php
@@ -238,6 +238,22 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
*/
public function get_login_data()
{
- return array();
+ $login_data = array();
+
+ foreach ($this->service_providers as $service_name => $service_provider)
+ {
+ // Only include data if the credentials are set
+ $credentials = $service_provider->get_service_credentials();
+ if ($credentials['key'] && $credentials['secret'])
+ {
+ $login_data[$service_provider] = array();
+
+ // Build the redirect url for the box
+ $redirect_url = build_url(false) . '&oauth_service=' . $service_name;
+ $login_data[$service_provider]['url'] = redirect($redirect_url, true);
+ }
+ }
+
+ return $login_data;
}
}
diff --git a/phpBB/styles/prosilver/template/login_body.html b/phpBB/styles/prosilver/template/login_body.html
index 4a51cf477f..85a47be4ad 100644
--- a/phpBB/styles/prosilver/template/login_body.html
+++ b/phpBB/styles/prosilver/template/login_body.html
@@ -49,7 +49,7 @@
</div><!-- IF OAUTH_LOGIN -->
<div class="content">
- hi
+
</div><!-- ENDIF -->
</div>
</div>