1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[feature/oauth] OAuth init method to minimally validate entered data

PHPBB3-11673
This commit is contained in:
Joseph Warner
2013-07-23 15:26:33 -04:00
parent 77c3264543
commit 9805927fac
2 changed files with 26 additions and 7 deletions

View File

@@ -103,6 +103,24 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
$this->service_providers = $service_providers;
}
/**
* {@inheritdoc}
*/
public function init()
{
// This does not test whether or not the key and secret provided are valid.
foreach ($this->service_providers as $service_provider)
{
$credentials = $service_provider->get_service_credentials();
if (($credentials['key'] && !$credentials['secret']) || (!$credentials['key'] && $credentials['secret']))
{
return $this->user->lang['AUTH_PROVIDER_OAUTH_ERROR_ELEMENT_MISSING'];
}
}
return false;
}
/**
* {@inheritdoc}
*/