last update for PM compatibility

This commit is contained in:
eriknyk
2014-08-20 12:05:12 -04:00
parent c108ea8678
commit 6437fddcc8

View File

@@ -182,7 +182,7 @@ class Server implements iAuthenticate
*
* @format JsonFormat,UploadFormat
*/
public function postAuthorize()
public function postAuthorize($authorize = null, $userId = null, $returnResponse = false)
{
session_start();
@@ -190,8 +190,12 @@ class Server implements iAuthenticate
throw new RestException(400, "Local Authentication Error, user session is not started.");
}
$userId = $_SESSION['USER_LOGGED'];
$authorize = array_key_exists('cancel', $_REQUEST)? false: true;
if (empty($userId)) {
$userId = $_SESSION['USER_LOGGED'];
}
if (empty($authorize)) {
$authorize = array_key_exists('cancel', $_REQUEST)? false: true;
}
$request = \OAuth2\Request::createFromGlobals();
$response = new \OAuth2\Response();
@@ -203,7 +207,11 @@ class Server implements iAuthenticate
$userId
);
die($response->send());
if ($returnResponse) {
return $response;
} else {
die($response->send());
}
}