fix
This commit is contained in:
1 parent
49c5bd8276
commit
fe3bd6ff4e
1 file changed
+8
@@ -26,6 +26,14 @@ class CAPI {
|
||||
$deviceId = $_REQUEST['deviceId'];
|
||||
|
||||
$arUserDevices = getUserDevices($USER['id']);
|
||||
|
||||
$canAccessToDevice = false;
|
||||
foreach($arUserDevices as $device) {
|
||||
if($device['id'] == $deviceId) {
|
||||
$canAccessToDevice = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!in_array($deviceId, $arUserDevices)) {
|
||||
return ['status' => 'fail', 'message' => 'Выбранное устройство не принадлежит текущему пользователю'];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user