Skip to content
Snippets Groups Projects
Commit db8593e0 authored by Janega Zoltán's avatar Janega Zoltán
Browse files
parent bc7cb6ec
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ class AuthSCHClient { ...@@ -10,7 +10,7 @@ class AuthSCHClient {
private $tokens; private $tokens;
public function __construct($tokens = null) { public function __construct($tokens = null) {
$this->tokens = new stdClass(); $this->tokens = new \stdClass();
if($tokens === null) { if($tokens === null) {
if(session_id() == '') { if(session_id() == '') {
...@@ -73,10 +73,12 @@ class AuthSCHClient { ...@@ -73,10 +73,12 @@ class AuthSCHClient {
$res = json_decode($ch); $res = json_decode($ch);
// check api access & redirect to auth.sch.bme.hu for authorization // check api access & redirect to auth.sch.bme.hu for authorization
if ($res != null && isset($res->success) && $res->success == true) if ($res != null && isset($res->success) && $res->success == true) {
header("Location: " . self::$host . "site/login?response_type=code&client_id=". self::$username ."&state=" . sha1($_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT']) . "&scope=" . self::$scope); header("Location: " . self::$host . "site/login?response_type=code&client_id=". self::$username ."&state=" . sha1($_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT']) . "&scope=" . self::$scope);
else die();
} else {
throw new Exception("error during api check"); throw new Exception("error during api check");
}
} else { } else {
$data = array( $data = array(
'grant_type'=>'authorization_code', 'grant_type'=>'authorization_code',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment