diff --git a/inc/lib/CAPI.class.php b/inc/lib/CAPI.class.php index 37def3b..15912e6 100644 --- a/inc/lib/CAPI.class.php +++ b/inc/lib/CAPI.class.php @@ -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' => 'Выбранное устройство не принадлежит текущему пользователю']; }