Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed some php typos #10

Open
wants to merge 2 commits into from

1 participant

Rui Cruz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 4, 2012
  1. Rui Cruz

    fixes php syntax typos

    csrui authored
Commits on Jun 20, 2012
  1. Rui Cruz
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 8 deletions.
  1. +1 −0  .gitignore
  2. +10 −8 lib/OAuth2.php
1  .gitignore
View
@@ -0,0 +1 @@
+.DS_Store
18 lib/OAuth2.php
View
@@ -864,7 +864,7 @@ public function getAuthorizeParams(array $inputData = NULL) {
}
// Return retrieved client details together with input
- return ($input + $stored);
+ return array_merge($input, $stored);
}
/**
@@ -895,26 +895,27 @@ public function getAuthorizeParams(array $inputData = NULL) {
*
* @ingroup oauth2_section_4
*/
- public function finishClientAuthorization($is_authorized, $user_id = NULL, $params = array()) {
-
+ public function finishClientAuthorization($is_authorized, $requester_user_id = NULL, $params = array()) {
+
// We repeat this, because we need to re-validate. In theory, this could be POSTed
// by a 3rd-party (because we are not internally enforcing NONCEs, etc)
$params = $this->getAuthorizeParams($params);
-
- $params += array('scope' => NULL, 'state' => NULL);
+
+ $params = array_merge($params, array('scope' => NULL, 'state' => NULL));
+
extract($params);
if ($state !== NULL) {
$result["query"]["state"] = $state;
}
-
+
if ($is_authorized === FALSE) {
throw new OAuth2RedirectException($redirect_uri, self::ERROR_USER_DENIED, "The user denied access to your application", $state);
} else {
if ($response_type == self::RESPONSE_TYPE_AUTH_CODE) {
- $result["query"]["code"] = $this->createAuthCode($client_id, $user_id, $redirect_uri, $scope);
+ $result["query"]["code"] = $this->createAuthCode($client_id, $requester_user_id, $redirect_uri, $scope);
} elseif ($response_type == self::RESPONSE_TYPE_ACCESS_TOKEN) {
- $result["fragment"] = $this->createAccessToken($client_id, $user_id, $scope);
+ $result["fragment"] = $this->createAccessToken($client_id, $requester_user_id, $scope);
}
}
@@ -1039,6 +1040,7 @@ protected function createAccessToken($client_id, $user_id, $scope = NULL) {
*/
private function createAuthCode($client_id, $user_id, $redirect_uri, $scope = NULL) {
$code = $this->genAuthCode();
+
$this->storage->setAuthCode($code, $client_id, $user_id, $redirect_uri, time() + $this->getVariable(self::CONFIG_AUTH_LIFETIME), $scope);
return $code;
}
Something went wrong with that request. Please try again.