Fixed associateAuthCodeScope() query

This commit is contained in:
Alex Bilbie 2013-05-10 17:29:28 -07:00
parent d531a37412
commit ef4a138237
2 changed files with 8 additions and 7 deletions

View File

@ -161,12 +161,12 @@ class Session implements SessionInterface
return ($result === false) ? false : (array) $result;
}
public function associateAuthCodeScope($sessionId, $scopeId)
public function associateAuthCodeScope($authCodeId, $scopeId)
{
$db = \ezcDbInstance::get();
$stmt = $db->prepare('INSERT INTO `oauth_session_authcode_scopes` (`session_id`, `scope_id`) VALUES (:sessionId, :scopeId)');
$stmt->bindValue(':sessionId', $sessionId);
$stmt = $db->prepare('INSERT INTO `oauth_session_authcode_scopes` (`oauth_session_authcode_id`, `scope_id`) VALUES (:authCodeId, :scopeId)');
$stmt->bindValue(':authCodeId', $authCodeId);
$stmt->bindValue(':scopeId', $scopeId);
$stmt->execute();
}

View File

@ -245,14 +245,15 @@ interface SessionInterface
* Example SQL query:
*
* <code>
* INSERT INTO `oauth_session_authcode_scopes` (`session_id`, `scope_id`) VALUES (:sessionId, :scopeId)
* INSERT INTO `oauth_session_authcode_scopes` (`oauth_session_authcode_id`, `scope_id`) VALUES
* (:authCodeId, :scopeId)
* </code>
*
* @param int $sessionId The session ID
* @param int $scopeId The scope ID
* @param int $authCodeId The auth code ID
* @param int $scopeId The scope ID
* @return void
*/
public function associateAuthCodeScope($sessionId, $scopeId);
public function associateAuthCodeScope($authCodeId, $scopeId);
/**
* Get the scopes associated with an auth code