mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 12:03:21 +01:00
[ticket/11700] Fix authentication acp after develop merge
PHPBB3-11700
This commit is contained in:
parent
09cfa01d58
commit
1fa673bded
@ -36,7 +36,7 @@ services:
|
||||
tags:
|
||||
- { name: auth.provider }
|
||||
auth.provider.oauth:
|
||||
class: phpbb_auth_provider_oauth
|
||||
class: phpbb\auth\provider\oauth\oauth
|
||||
arguments:
|
||||
- @dbal.conn
|
||||
- @config
|
||||
@ -51,27 +51,27 @@ services:
|
||||
tags:
|
||||
- { name: auth.provider }
|
||||
auth.provider.oauth.service_collection:
|
||||
class: phpbb_di_service_collection
|
||||
class: phpbb\di\service_collection
|
||||
arguments:
|
||||
- @service_container
|
||||
tags:
|
||||
- { name: service_collection, tag: auth.provider.oauth.service }
|
||||
auth.provider.oauth.service.bitly:
|
||||
class: phpbb_auth_provider_oauth_service_bitly
|
||||
class: phpbb\auth\provider\oauth\service\bitly
|
||||
arguments:
|
||||
- @config
|
||||
- @request
|
||||
tags:
|
||||
- { name: auth.provider.oauth.service }
|
||||
auth.provider.oauth.service.facebook:
|
||||
class: phpbb_auth_provider_oauth_service_facebook
|
||||
class: phpbb\auth\provider\oauth\service\facebook
|
||||
arguments:
|
||||
- @config
|
||||
- @request
|
||||
tags:
|
||||
- { name: auth.provider.oauth.service }
|
||||
auth.provider.oauth.service.google:
|
||||
class: phpbb_auth_provider_oauth_service_google
|
||||
class: phpbb\auth\provider\oauth\service\google
|
||||
arguments:
|
||||
- @config
|
||||
- @request
|
||||
|
@ -30,7 +30,7 @@ class oauth extends \phpbb\auth\provider\base
|
||||
/**
|
||||
* Database driver
|
||||
*
|
||||
* @var \phpbb\db\driver
|
||||
* @var \phpbb\db\driver\driver
|
||||
*/
|
||||
protected $db;
|
||||
|
||||
@ -107,7 +107,7 @@ class oauth extends \phpbb\auth\provider\base
|
||||
/**
|
||||
* OAuth Authentication Constructor
|
||||
*
|
||||
* @param \phpbb\db\driver $db
|
||||
* @param \phpbb\db\driver\driver $db
|
||||
* @param \phpbb\config\config $config
|
||||
* @param \phpbb\request\request_interface $request
|
||||
* @param \phpbb\user $user
|
||||
@ -118,7 +118,7 @@ class oauth extends \phpbb\auth\provider\base
|
||||
* @param string $phpbb_root_path
|
||||
* @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->config = $config;
|
||||
|
@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\auth\provider\oauth\service;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@ -20,7 +22,7 @@ if (!defined('IN_PHPBB'))
|
||||
*
|
||||
* @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
|
||||
|
@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\auth\provider\oauth\service;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@ -20,29 +22,29 @@ if (!defined('IN_PHPBB'))
|
||||
*
|
||||
* @package auth
|
||||
*/
|
||||
class phpbb_auth_provider_oauth_service_facebook extends phpbb_auth_provider_oauth_service_base
|
||||
class facebook extends base
|
||||
{
|
||||
/**
|
||||
* phpBB config
|
||||
*
|
||||
* @var phpbb_config
|
||||
* @var phpbb\config\config
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* phpBB request
|
||||
*
|
||||
* @var phpbb_request
|
||||
* @var phpbb\request\request_interface
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param phpbb_config $config
|
||||
* @param phpbb_request $request
|
||||
* @param phpbb\config\config $config
|
||||
* @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->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))
|
||||
{
|
||||
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
|
||||
@ -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))
|
||||
{
|
||||
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
|
||||
|
@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\auth\provider\oauth\service;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@ -20,29 +22,29 @@ if (!defined('IN_PHPBB'))
|
||||
*
|
||||
* @package auth
|
||||
*/
|
||||
class phpbb_auth_provider_oauth_service_google extends phpbb_auth_provider_oauth_service_base
|
||||
class google extends base
|
||||
{
|
||||
/**
|
||||
* phpBB config
|
||||
*
|
||||
* @var phpbb_config
|
||||
* @var phpbb\config\config
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* phpBB request
|
||||
*
|
||||
* @var phpbb_request
|
||||
* @var phpbb\request\request_interface
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param phpbb_config $config
|
||||
* @param phpbb_request $request
|
||||
* @param phpbb\config\config $config
|
||||
* @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->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))
|
||||
{
|
||||
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
|
||||
@ -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))
|
||||
{
|
||||
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
|
||||
|
@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\auth\provider\oauth\service;
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
@ -20,7 +22,7 @@ if (!defined('IN_PHPBB'))
|
||||
*
|
||||
* @package auth
|
||||
*/
|
||||
interface phpbb_auth_provider_oauth_service_interface
|
||||
interface service_interface
|
||||
{
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @throws phpbb_auth_provider_oauth_service_exception
|
||||
* @throws \phpbb\auth\provider\oauth\service\exception
|
||||
* @return string The unique identifier returned by the service provider
|
||||
* 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
|
||||
* 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
|
||||
* that is used to authenticate the user with phpBB.
|
||||
*/
|
Loading…
x
Reference in New Issue
Block a user