From 3c7fe00130cf4525f937351af8634e102edfb88e Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Mon, 4 Feb 2013 14:41:40 +0000 Subject: [PATCH] Renamed some session methods to avoid conflicts with ORM methods --- src/OAuth2/AuthServer.php | 4 ++-- src/OAuth2/Grant/AuthCode.php | 2 +- src/OAuth2/Grant/ClientCredentials.php | 4 ++-- src/OAuth2/Storage/SessionInterface.php | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/OAuth2/AuthServer.php b/src/OAuth2/AuthServer.php index c09ac8d5..92c4ac82 100644 --- a/src/OAuth2/AuthServer.php +++ b/src/OAuth2/AuthServer.php @@ -243,10 +243,10 @@ class AuthServer $authCode = SecureKey::make(); // Remove any old sessions the user might have - self::getStorage('session')->delete($authParams['client_id'], $type, $typeId); + self::getStorage('session')->deleteSession($authParams['client_id'], $type, $typeId); // Create a new session - $sessionId = self::getStorage('session')->create($authParams['client_id'], $authParams['redirect_uri'], $type, $typeId, $authCode); + $sessionId = self::getStorage('session')->createSession($authParams['client_id'], $authParams['redirect_uri'], $type, $typeId, $authCode); // Associate scopes with the new session foreach ($authParams['scopes'] as $scope) diff --git a/src/OAuth2/Grant/AuthCode.php b/src/OAuth2/Grant/AuthCode.php index 758611e3..960996c2 100644 --- a/src/OAuth2/Grant/AuthCode.php +++ b/src/OAuth2/Grant/AuthCode.php @@ -88,7 +88,7 @@ class AuthCode implements GrantTypeInterface { $accessTokenExpires = time() + AuthServer::getExpiresIn(); $accessTokenExpiresIn = AuthServer::getExpiresIn(); - AuthServer::getStorage('session')->update( + AuthServer::getStorage('session')->updateSession( $session['id'], null, $accessToken, diff --git a/src/OAuth2/Grant/ClientCredentials.php b/src/OAuth2/Grant/ClientCredentials.php index fe5ee23e..75380819 100644 --- a/src/OAuth2/Grant/ClientCredentials.php +++ b/src/OAuth2/Grant/ClientCredentials.php @@ -62,10 +62,10 @@ class ClientCredentials implements GrantTypeInterface { $accessTokenExpiresIn = AuthServer::getExpiresIn(); // Delete any existing sessions just to be sure - AuthServer::getStorage('session')->delete($authParams['client_id'], 'client', $authParams['client_id']); + AuthServer::getStorage('session')->deleteSession($authParams['client_id'], 'client', $authParams['client_id']); // Create a new session - AuthServer::getStorage('session')->create( + AuthServer::getStorage('session')->createSession( $authParams['client_id'], null, 'client', diff --git a/src/OAuth2/Storage/SessionInterface.php b/src/OAuth2/Storage/SessionInterface.php index a84e50d2..f886339a 100644 --- a/src/OAuth2/Storage/SessionInterface.php +++ b/src/OAuth2/Storage/SessionInterface.php @@ -26,7 +26,7 @@ interface SessionInterface * @param string $stage The stage of the session (default ="request") * @return int The session ID */ - public function create( + public function createSession( $clientId, $redirectUri, $type = 'user', @@ -56,7 +56,7 @@ interface SessionInterface * @param string $stage The stage of the session (default ="request") * @return void */ - public function update( + public function updateSession( $sessionId, $authCode = null, $accessToken = null, @@ -78,7 +78,7 @@ interface SessionInterface * @param string $typeId The session owner's ID * @return void */ - public function delete( + public function deleteSession( $clientId, $type, $typeId @@ -100,7 +100,7 @@ interface SessionInterface * @return string|null Return the session ID as an integer if * found otherwise returns false */ - public function exists( + public function sessionExists( $type, $typeId, $clientId