1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[feature/oauth] Possible way of getting the login data to login_box()

PHPBB3-11673
This commit is contained in:
Joseph Warner
2013-07-22 16:35:18 -04:00
parent cd49cfacfb
commit 0be81468e7
2 changed files with 18 additions and 2 deletions

View File

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