[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() 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;
} }
} }

View file

@ -49,7 +49,7 @@
</div><!-- IF OAUTH_LOGIN --> </div><!-- IF OAUTH_LOGIN -->
<div class="content"> <div class="content">
hi
</div><!-- ENDIF --> </div><!-- ENDIF -->
</div> </div>
</div> </div>