diff options
| author | Joseph Warner <hardolaf@hardolaf.com> | 2013-07-23 15:26:33 -0400 |
|---|---|---|
| committer | Joseph Warner <hardolaf@hardolaf.com> | 2013-07-23 15:26:57 -0400 |
| commit | 9805927fac30d9c5d99f5f5f8d7207c9a6064724 (patch) | |
| tree | ed91fe12f034caa99c4f43f832b921482adc564c /phpBB/phpbb/auth | |
| parent | 77c32645437c77e99f36f6595e1a42cd0f7b7235 (diff) | |
| download | forums-9805927fac30d9c5d99f5f5f8d7207c9a6064724.tar forums-9805927fac30d9c5d99f5f5f8d7207c9a6064724.tar.gz forums-9805927fac30d9c5d99f5f5f8d7207c9a6064724.tar.bz2 forums-9805927fac30d9c5d99f5f5f8d7207c9a6064724.tar.xz forums-9805927fac30d9c5d99f5f5f8d7207c9a6064724.zip | |
[feature/oauth] OAuth init method to minimally validate entered data
PHPBB3-11673
Diffstat (limited to 'phpBB/phpbb/auth')
| -rw-r--r-- | phpBB/phpbb/auth/provider/oauth/oauth.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php index 978c84cd6d..a2d5c3fcd5 100644 --- a/phpBB/phpbb/auth/provider/oauth/oauth.php +++ b/phpBB/phpbb/auth/provider/oauth/oauth.php @@ -106,6 +106,24 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base /** * {@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} + */ public function login($username, $password) { // Temporary workaround for only having one authentication provider available |
