diff options
| author | Joseph Warner <hardolaf@hardolaf.com> | 2013-07-13 16:51:38 -0400 | 
|---|---|---|
| committer | Joseph Warner <hardolaf@hardolaf.com> | 2013-07-14 14:22:42 -0400 | 
| commit | 24bf333e161332ddd589831228e35ad9eb1e8f18 (patch) | |
| tree | 1f75cd05e829dd8e59c93c5dca914fea3b97a95a /phpBB/includes/auth | |
| parent | 37f099b014ea34378096c50cf898c060bd3f0d42 (diff) | |
| download | forums-24bf333e161332ddd589831228e35ad9eb1e8f18.tar forums-24bf333e161332ddd589831228e35ad9eb1e8f18.tar.gz forums-24bf333e161332ddd589831228e35ad9eb1e8f18.tar.bz2 forums-24bf333e161332ddd589831228e35ad9eb1e8f18.tar.xz forums-24bf333e161332ddd589831228e35ad9eb1e8f18.zip  | |
[feature/oauth] Use DB for OAuth token storage
PHPBB3-11673
Diffstat (limited to 'phpBB/includes/auth')
| -rw-r--r-- | phpBB/includes/auth/oauth/token_storage.php | 18 | ||||
| -rw-r--r-- | phpBB/includes/auth/provider/oauth.php | 13 | 
2 files changed, 15 insertions, 16 deletions
diff --git a/phpBB/includes/auth/oauth/token_storage.php b/phpBB/includes/auth/oauth/token_storage.php index 2d3c58d25a..b658333900 100644 --- a/phpBB/includes/auth/oauth/token_storage.php +++ b/phpBB/includes/auth/oauth/token_storage.php @@ -28,9 +28,16 @@ class phpbb_auth_oauth_token_storage implements TokenStorageInterface  	/**  	* Cache driver.  	* -	* @var phpbb_cache_driver_interface +	* @var phpbb_db_driver  	*/ -	protected $driver; +	protected $db; + +	/** +	* Name of the OAuth provider +	* +	* @var string +	*/ +	protected $service_name;  	/**  	* @var object|TokenInterface @@ -40,11 +47,12 @@ class phpbb_auth_oauth_token_storage implements TokenStorageInterface  	/**  	* Creates token storage for phpBB.  	* -	* @param phpbb_cache_driver_interface $driver The cache driver +	* @param phpbb_db_driver	$db  	*/ -	public function __construct(phpbb_cache_driver_interface $driver) +	public function __construct(phpbb_db_driver $db, $service_name)  	{ -		$this->driver = $driver; +		$this->db = $db; +		$this->service_name = $service_name;  	}  	/** diff --git a/phpBB/includes/auth/provider/oauth.php b/phpBB/includes/auth/provider/oauth.php index 267105e6b6..55a12211d6 100644 --- a/phpBB/includes/auth/provider/oauth.php +++ b/phpBB/includes/auth/provider/oauth.php @@ -54,13 +54,6 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base  	protected $user;  	/** -	* Cache driver. -	* -	* @var phpbb_cache_driver_interface -	*/ -	protected $driver; - -	/**  	* Cached service once it has been created  	*  	* @var \OAuth\Common\Service\ServiceInterface|null @@ -81,15 +74,13 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base  	* @param 	phpbb_config 					$config  	* @param 	phpbb_request 					$request  	* @param 	phpbb_user 						$user -	* @param	phpbb_cache_driver_interface	$driver  	*/ -	public function __construct(phpbb_db_driver $db, phpbb_config $config, phpbb_request $request, phpbb_user $user, phpbb_cache_driver_interface $driver) +	public function __construct(phpbb_db_driver $db, phpbb_config $config, phpbb_request $request, phpbb_user $user)  	{  		$this->db = $db;  		$this->config = $config;  		$this->request = $request;  		$this->user = $user; -		$this->driver = $driver;  	}  	/** @@ -186,7 +177,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base  			return $this->service;  		} -		$storage = new phpbb_auth_oauth_token_storage($this->driver); +		$storage = new phpbb_auth_oauth_token_storage($this->db, $service_name);  		$current_uri = $this->get_current_uri();  | 
