parent
16557465e4
commit
59bd71c75d
@ -9,11 +9,13 @@ $api->isActive();
|
||||
// Check user token
|
||||
$user_id = $user->checkApiKey($_REQUEST['api_key']);
|
||||
|
||||
echo $user_id;
|
||||
|
||||
// We have to check if that user is admin too
|
||||
if ( ! $user->isAdmin($user_id) && ($_REQUEST['id'] != $user_id && !empty($_REQUEST['id']))) {
|
||||
header("HTTP/1.1 401 Unauthorized");
|
||||
die("Access denied");
|
||||
} else if ($user->isAdmin($user_id)) {
|
||||
} else if ($user->isAdmin($user_id) && !empty($_REQUEST['id'])) {
|
||||
$id = $_REQUEST['id'];
|
||||
ctype_digit($_REQUEST['id']) ? $id = $_REQUEST['id'] : $id = $user->getUserId($_REQUEST['id']);
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user