Updated calls for user session
Users token session must be set for calls to work
This commit is contained in:
parent
5fafca6dd4
commit
c435d43137
11
calls.php
11
calls.php
|
@ -2,8 +2,10 @@
|
|||
header('Access-Control-Allow-Origin: *');
|
||||
header('Content-Type: application/json');
|
||||
require_once('class.php');
|
||||
$auth = new auth();
|
||||
$auth->sessionStartIfNone();
|
||||
if (isset($_SESSION['token'])) {
|
||||
$idle = new idlers();
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
if (isset($_GET['type'])) {
|
||||
if ($_GET['type'] == 'server') {
|
||||
|
@ -98,3 +100,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
|||
die();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
header('HTTP/1.1 401 Unauthorized');
|
||||
echo json_encode(array(
|
||||
'code' => 401,
|
||||
'message' => 'Unauthorized'));
|
||||
exit;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user