[ticket/11700] Fix authentication acp after develop merge

PHPBB3-11700
This commit is contained in:
Nils Adermann 2013-09-16 03:22:13 +02:00
parent 09cfa01d58
commit 1fa673bded
6 changed files with 36 additions and 28 deletions

View file

@ -36,7 +36,7 @@ services:
tags: tags:
- { name: auth.provider } - { name: auth.provider }
auth.provider.oauth: auth.provider.oauth:
class: phpbb_auth_provider_oauth class: phpbb\auth\provider\oauth\oauth
arguments: arguments:
- @dbal.conn - @dbal.conn
- @config - @config
@ -51,27 +51,27 @@ services:
tags: tags:
- { name: auth.provider } - { name: auth.provider }
auth.provider.oauth.service_collection: auth.provider.oauth.service_collection:
class: phpbb_di_service_collection class: phpbb\di\service_collection
arguments: arguments:
- @service_container - @service_container
tags: tags:
- { name: service_collection, tag: auth.provider.oauth.service } - { name: service_collection, tag: auth.provider.oauth.service }
auth.provider.oauth.service.bitly: auth.provider.oauth.service.bitly:
class: phpbb_auth_provider_oauth_service_bitly class: phpbb\auth\provider\oauth\service\bitly
arguments: arguments:
- @config - @config
- @request - @request
tags: tags:
- { name: auth.provider.oauth.service } - { name: auth.provider.oauth.service }
auth.provider.oauth.service.facebook: auth.provider.oauth.service.facebook:
class: phpbb_auth_provider_oauth_service_facebook class: phpbb\auth\provider\oauth\service\facebook
arguments: arguments:
- @config - @config
- @request - @request
tags: tags:
- { name: auth.provider.oauth.service } - { name: auth.provider.oauth.service }
auth.provider.oauth.service.google: auth.provider.oauth.service.google:
class: phpbb_auth_provider_oauth_service_google class: phpbb\auth\provider\oauth\service\google
arguments: arguments:
- @config - @config
- @request - @request

View file

@ -30,7 +30,7 @@ class oauth extends \phpbb\auth\provider\base
/** /**
* Database driver * Database driver
* *
* @var \phpbb\db\driver * @var \phpbb\db\driver\driver
*/ */
protected $db; protected $db;
@ -107,7 +107,7 @@ class oauth extends \phpbb\auth\provider\base
/** /**
* OAuth Authentication Constructor * OAuth Authentication Constructor
* *
* @param \phpbb\db\driver $db * @param \phpbb\db\driver\driver $db
* @param \phpbb\config\config $config * @param \phpbb\config\config $config
* @param \phpbb\request\request_interface $request * @param \phpbb\request\request_interface $request
* @param \phpbb\user $user * @param \phpbb\user $user
@ -118,7 +118,7 @@ class oauth extends \phpbb\auth\provider\base
* @param string $phpbb_root_path * @param string $phpbb_root_path
* @param string $php_ext * @param string $php_ext
*/ */
public function __construct(\phpbb\db\driver $db, \phpbb\config\config $config, \phpbb\request\request_interface $request, \phpbb\user $user, $auth_provider_oauth_token_storage_table, $auth_provider_oauth_token_account_assoc, \phpbb\di\service_collection $service_providers, $users_table, $phpbb_root_path, $php_ext) public function __construct(\phpbb\db\driver\driver $db, \phpbb\config\config $config, \phpbb\request\request_interface $request, \phpbb\user $user, $auth_provider_oauth_token_storage_table, $auth_provider_oauth_token_account_assoc, \phpbb\di\service_collection $service_providers, $users_table, $phpbb_root_path, $php_ext)
{ {
$this->db = $db; $this->db = $db;
$this->config = $config; $this->config = $config;

View file

@ -7,6 +7,8 @@
* *
*/ */
namespace phpbb\auth\provider\oauth\service;
/** /**
* @ignore * @ignore
*/ */
@ -20,7 +22,7 @@ if (!defined('IN_PHPBB'))
* *
* @package auth * @package auth
*/ */
abstract class phpbb_auth_provider_oauth_service_base implements phpbb_auth_provider_oauth_service_interface abstract class base implements \phpbb\auth\provider\oauth\service\service_interface
{ {
/** /**
* External OAuth service provider * External OAuth service provider

View file

@ -7,6 +7,8 @@
* *
*/ */
namespace phpbb\auth\provider\oauth\service;
/** /**
* @ignore * @ignore
*/ */
@ -20,29 +22,29 @@ if (!defined('IN_PHPBB'))
* *
* @package auth * @package auth
*/ */
class phpbb_auth_provider_oauth_service_facebook extends phpbb_auth_provider_oauth_service_base class facebook extends base
{ {
/** /**
* phpBB config * phpBB config
* *
* @var phpbb_config * @var phpbb\config\config
*/ */
protected $config; protected $config;
/** /**
* phpBB request * phpBB request
* *
* @var phpbb_request * @var phpbb\request\request_interface
*/ */
protected $request; protected $request;
/** /**
* Constructor * Constructor
* *
* @param phpbb_config $config * @param phpbb\config\config $config
* @param phpbb_request $request * @param phpbb\request\request_interface $request
*/ */
public function __construct(phpbb_config $config, phpbb_request $request) public function __construct(\phpbb\config\config $config, \phpbb\request\request_interface $request)
{ {
$this->config = $config; $this->config = $config;
$this->request = $request; $this->request = $request;
@ -66,7 +68,7 @@ class phpbb_auth_provider_oauth_service_facebook extends phpbb_auth_provider_oau
{ {
if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Facebook)) if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Facebook))
{ {
throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); throw new exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
} }
// This was a callback request, get the token // This was a callback request, get the token
@ -86,7 +88,7 @@ class phpbb_auth_provider_oauth_service_facebook extends phpbb_auth_provider_oau
{ {
if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Facebook)) if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Facebook))
{ {
throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); throw new exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
} }
// Send a request with it // Send a request with it

View file

@ -7,6 +7,8 @@
* *
*/ */
namespace phpbb\auth\provider\oauth\service;
/** /**
* @ignore * @ignore
*/ */
@ -20,29 +22,29 @@ if (!defined('IN_PHPBB'))
* *
* @package auth * @package auth
*/ */
class phpbb_auth_provider_oauth_service_google extends phpbb_auth_provider_oauth_service_base class google extends base
{ {
/** /**
* phpBB config * phpBB config
* *
* @var phpbb_config * @var phpbb\config\config
*/ */
protected $config; protected $config;
/** /**
* phpBB request * phpBB request
* *
* @var phpbb_request * @var phpbb\request\request_interface
*/ */
protected $request; protected $request;
/** /**
* Constructor * Constructor
* *
* @param phpbb_config $config * @param phpbb\config\config $config
* @param phpbb_request $request * @param phpbb\request\request_interface $request
*/ */
public function __construct(phpbb_config $config, phpbb_request $request) public function __construct(\phpbb\config\config $config, \phpbb\request\request_interface $request)
{ {
$this->config = $config; $this->config = $config;
$this->request = $request; $this->request = $request;
@ -77,7 +79,7 @@ class phpbb_auth_provider_oauth_service_google extends phpbb_auth_provider_oauth
{ {
if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Google)) if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Google))
{ {
throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); throw new exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
} }
// This was a callback request, get the token // This was a callback request, get the token
@ -97,7 +99,7 @@ class phpbb_auth_provider_oauth_service_google extends phpbb_auth_provider_oauth
{ {
if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Google)) if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Google))
{ {
throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE'); throw new exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
} }
// Send a request with it // Send a request with it

View file

@ -7,6 +7,8 @@
* *
*/ */
namespace phpbb\auth\provider\oauth\service;
/** /**
* @ignore * @ignore
*/ */
@ -20,7 +22,7 @@ if (!defined('IN_PHPBB'))
* *
* @package auth * @package auth
*/ */
interface phpbb_auth_provider_oauth_service_interface interface service_interface
{ {
/** /**
* Returns an array of the scopes necessary for auth * Returns an array of the scopes necessary for auth
@ -52,7 +54,7 @@ interface phpbb_auth_provider_oauth_service_interface
/** /**
* Returns the results of the authentication in json format * Returns the results of the authentication in json format
* *
* @throws phpbb_auth_provider_oauth_service_exception * @throws \phpbb\auth\provider\oauth\service\exception
* @return string The unique identifier returned by the service provider * @return string The unique identifier returned by the service provider
* that is used to authenticate the user with phpBB. * that is used to authenticate the user with phpBB.
*/ */
@ -62,7 +64,7 @@ interface phpbb_auth_provider_oauth_service_interface
* Returns the results of the authentication in json format * Returns the results of the authentication in json format
* Use this function when the user already has an access token * Use this function when the user already has an access token
* *
* @throws phpbb_auth_provider_oauth_service_exception * @throws \phpbb\auth\provider\oauth\service\exception
* @return string The unique identifier returned by the service provider * @return string The unique identifier returned by the service provider
* that is used to authenticate the user with phpBB. * that is used to authenticate the user with phpBB.
*/ */