[feature/oauth] Fix errors found in testing linking

PHPBB3-11673
This commit is contained in:
Joseph Warner 2013-08-14 16:01:59 -04:00
parent bb68338861
commit cd12786e58
2 changed files with 4 additions and 7 deletions

View file

@ -58,7 +58,7 @@ class ucp_auth_link
// Tell the provider that the method is auth_link not login_link
$link_data['link_method'] = 'auth_link';
if ($request->variable('link', null, false, phpbb_request_interface::POST))
if ($request->variable('link', 0, false, phpbb_request_interface::POST))
{
$error[] = $auth_provider->link_account($link_data);
}

View file

@ -391,10 +391,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
// We must have an oauth_service listed, check for it two ways
if (!array_key_exists('oauth_service', $link_data) || !$link_data['oauth_service'])
{
if (!$link_data['oauth_service'] && $this->request->is_set('oauth_service'))
{
$link_data['oauth_service'] = $this->request->variable('oauth_service', '');
}
$link_data['oauth_service'] = $this->request->variable('oauth_service', false);
if (!$link_data['oauth_service'])
{
@ -452,7 +449,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
protected function link_account_auth_link(array $link_data, $service_name)
{
$storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $service_name, $this->auth_provider_oauth_token_storage_table);
$query = 'i=ucp_auth_link&mode=auth_link&link=1&login_link_oauth_service=' . strtolower($link_data['oauth_service']);
$query = 'i=ucp_auth_link&mode=auth_link&link=1&oauth_service=' . strtolower($link_data['oauth_service']);
$service_credentials = $this->service_providers[$service_name]->get_service_credentials();
$scopes = $this->service_providers[$service_name]->get_auth_scope();
$service = $this->get_service(strtolower($link_data['oauth_service']), $storage, $service_credentials, $scopes, $query);
@ -464,7 +461,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
// Insert into table, they will be able to log in after this
$data = array(
'user_id' => $link_data['user_id'],
'user_id' => $this->user->data['user_id'],
'provider' => strtolower($link_data['oauth_service']),
'oauth_provider_id' => $unique_id,
);