|
@@ -513,8 +513,9 @@ namespace Api\Htb {
|
|
|
));
|
|
|
|
|
|
if (!empty($query->getRows())) {
|
|
|
- $query->execute();
|
|
|
- $this->lastError = $sql->getLastError();
|
|
|
+ if(!$query->execute()) {
|
|
|
+ $this->lastError = $sql->getLastError();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -560,6 +561,9 @@ namespace Api\Htb {
|
|
|
$rootAccess = $htbUser["machineOwns"][$machineId]["root"];
|
|
|
$this->result["unlock"] = array("user" => $userAccess, "root" => $rootAccess);
|
|
|
$this->logAccess($userId, $machineId, $userAccess, $rootAccess);
|
|
|
+ if (!$userAccess && !$rootAccess) {
|
|
|
+ $this->createError("You did not own the machine yet.");
|
|
|
+ }
|
|
|
} else {
|
|
|
$ownedMachines = $this->fetchOwnedMachines($userId);
|
|
|
if (!$this->success) {
|