From d63c0ea2622d960de0f99afebf6575776023ff7d Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Tue, 29 Jan 2013 14:16:47 +0000 Subject: [PATCH] Added model variable storage --- src/OAuth2/AuthServer.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/OAuth2/AuthServer.php b/src/OAuth2/AuthServer.php index 9008d829..62c42b9e 100644 --- a/src/OAuth2/AuthServer.php +++ b/src/OAuth2/AuthServer.php @@ -2,6 +2,10 @@ namespace OAuth2; +use OAuth2\Storage\SessionInterface; +use OAuth2\Storage\ClientInterface; +use OAuth2\Storage\ScopeInterface; + class AuthServer { protected $scopeDelimeter = ','; @@ -18,9 +22,14 @@ class AuthServer protected $request = null; - public function __construct($storage) - { + public function __construct(ClientInterface $client, SessionInterface $session, ScopeInterface $scope) + { + $this->storages = array( + 'client' => $client, + 'session' => $session, + 'scope' => $scope + ); } public function addGrantType(GrantTypeInterface $grant_type, $identifier = null) @@ -75,6 +84,11 @@ class AuthServer return $this->request; } + public function getStorage($obj) + { + return $this->storages[$obj]; + } + /** * Check client authorise parameters *