Anal space fixes

This commit is contained in:
Alex Bilbie 2013-06-02 14:59:05 +01:00
parent 0999bf4de3
commit f78e05cb08
2 changed files with 21 additions and 22 deletions

View File

@ -11,22 +11,22 @@ class Client implements ClientInterface {
{
if ( ! is_null($redirectUri) && is_null($clientSecret)) {
$result = DB::table('oauth_clients')
->join('oauth_client_endpoints', 'oauth_clients.id', '=', 'oauth_client_endpoints.client_id')
->where('oauth_clients.id', $clientId)
->where('oauth_client_endpoints.redirect_uri', $redirectUri)
->first();
->join('oauth_client_endpoints', 'oauth_clients.id', '=', 'oauth_client_endpoints.client_id')
->where('oauth_clients.id', $clientId)
->where('oauth_client_endpoints.redirect_uri', $redirectUri)
->first();
} elseif ( ! is_null($clientSecret) && is_null($redirectUri)) {
$result = DB::table('oauth_clients')
->where('id', $clientId)
->where('secret', $clientSecret)
->first();
->where('id', $clientId)
->where('secret', $clientSecret)
->first();
} elseif ( ! is_null($clientSecret) && ! is_null($redirectUri)) {
$result = DB::table('oauth_clients')
->join('oauth_client_endpoints', 'oauth_clients.id', '=', 'oauth_client_endpoints.client_id')
->where('oauth_clients.id', $clientId)
->where('oauth_clients.secret', $clientSecret)
->where('oauth_client_endpoints.redirect_uri', $redirectUri)
->first();
->join('oauth_client_endpoints', 'oauth_clients.id', '=', 'oauth_client_endpoints.client_id')
->where('oauth_clients.id', $clientId)
->where('oauth_clients.secret', $clientSecret)
->where('oauth_client_endpoints.redirect_uri', $redirectUri)
->first();
}
if (is_null($result)) {

View File

@ -8,21 +8,20 @@ use \League\OAuth2\Server\Storage\ScopeInterface;
class Scope implements ScopeInterface {
public function getScope($scope, $clientId = null, $grantType = null)
{
$result = DB::table('oauth_scopes')
->where('key', $scope)
->first();
{
$result = DB::table('oauth_scopes')
->where('key', $scope)
->first();
if (is_null($result)) {
return false;
}
return array(
'id' => $result->id,
'scope' => $result->key,
'name' => $result->name,
'description' => $result->description
'id' => $result->id,
'scope' => $result->key,
'name' => $result->name,
'description' => $result->description
);
}
}
}