Spacing updates

This commit is contained in:
Alex Bilbie 2012-11-20 15:26:04 +00:00
parent ac990b609a
commit 21f48c0491

View File

@ -23,11 +23,7 @@ class OAuthdb implements Database
'description' => 'test' 'description' => 'test'
)); ));
public function validateClient( public function validateClient($clientId, $clientSecret = null, $redirectUri = null)
$clientId,
$clientSecret = null,
$redirectUri = null
)
{ {
if ($clientId !== $this->clients[0]['client_id']) if ($clientId !== $this->clients[0]['client_id'])
{ {
@ -47,16 +43,7 @@ class OAuthdb implements Database
return $this->clients[0]; return $this->clients[0];
} }
public function newSession( public function newSession($clientId, $redirectUri, $type = 'user', $typeId = null, $authCode = null, $accessToken = null, $accessTokenExpire = null, $stage = 'requested')
$clientId,
$redirectUri,
$type = 'user',
$typeId = null,
$authCode = null,
$accessToken = null,
$accessTokenExpire = null,
$stage = 'requested'
)
{ {
$id = count($this->sessions); $id = count($this->sessions);
@ -75,16 +62,10 @@ class OAuthdb implements Database
$this->sessions_client_type_id[$clientId . ':' . $type . ':' . $typeId] = $id; $this->sessions_client_type_id[$clientId . ':' . $type . ':' . $typeId] = $id;
$this->sessions_code[$clientId . ':' . $redirectUri . ':' . $authCode] = $id; $this->sessions_code[$clientId . ':' . $redirectUri . ':' . $authCode] = $id;
return true; return $id;
} }
public function updateSession( public function updateSession($sessionId, $authCode = null, $accessToken = null, $accessTokenExpire = null, $stage = 'requested')
$sessionId,
$authCode = null,
$accessToken = null,
$accessTokenExpire = null,
$stage = 'requested'
)
{ {
$this->sessions[$sessionId]['auth_code'] = $authCode; $this->sessions[$sessionId]['auth_code'] = $authCode;
$this->sessions[$sessionId]['access_token'] = $accessToken; $this->sessions[$sessionId]['access_token'] = $accessToken;
@ -94,11 +75,7 @@ class OAuthdb implements Database
return true; return true;
} }
public function deleteSession( public function deleteSession($clientId, $type, $typeId)
$clientId,
$type,
$typeId
)
{ {
$key = $clientId . ':' . $type . ':' . $typeId; $key = $clientId . ':' . $type . ':' . $typeId;
if (isset($this->sessions_client_type_id[$key])) if (isset($this->sessions_client_type_id[$key]))
@ -108,11 +85,7 @@ class OAuthdb implements Database
return true; return true;
} }
public function validateAuthCode( public function validateAuthCode($clientId, $redirectUri, $authCode)
$clientId,
$redirectUri,
$authCode
)
{ {
$key = $clientId . ':' . $redirectUri . ':' . $authCode; $key = $clientId . ':' . $redirectUri . ':' . $authCode;
@ -124,11 +97,7 @@ class OAuthdb implements Database
return false; return false;
} }
public function hasSession( public function hasSession($type, $typeId, $clientId)
$type,
$typeId,
$clientId
)
{ {
die('not implemented hasSession'); die('not implemented hasSession');
} }
@ -151,10 +120,7 @@ class OAuthdb implements Database
die('not implemented setAccessToken'); die('not implemented setAccessToken');
} }
public function addSessionScope( public function addSessionScope($sessionId, $scope)
$sessionId,
$scope
)
{ {
if ( ! isset($this->session_scopes[$sessionId])) if ( ! isset($this->session_scopes[$sessionId]))
{ {
@ -176,10 +142,7 @@ class OAuthdb implements Database
return $this->scopes[$scope]; return $this->scopes[$scope];
} }
public function updateSessionScopeAccessToken( public function updateSessionScopeAccessToken($sessionId, $accessToken)
$sessionId,
$accessToken
)
{ {
return true; return true;
} }