|
|
|
@ -120,7 +120,7 @@ switch ($VARS['action']) {
|
|
|
|
|
case "addmachine":
|
|
|
|
|
dieWithoutRole(Roles::ROLE_ADDEDIT);
|
|
|
|
|
if (empty($VARS['id'])) {
|
|
|
|
|
sendError("nomachineid");
|
|
|
|
|
$VARS['id'] = Machine::generateId();
|
|
|
|
|
}
|
|
|
|
|
if ($database->has('machines', ['machineid' => $VARS['id']])) {
|
|
|
|
|
sendError("", "A machine with that ID already exists.");
|
|
|
|
@ -157,7 +157,7 @@ switch ($VARS['action']) {
|
|
|
|
|
if ($database->error()[1] != 0) {
|
|
|
|
|
sendError("dberror", $database->error()[2]);
|
|
|
|
|
}
|
|
|
|
|
exit(json_encode(["status" => "OK"]));
|
|
|
|
|
exit(json_encode(["status" => "OK", "id" => $data['machineid']]));
|
|
|
|
|
break;
|
|
|
|
|
case "addhistory":
|
|
|
|
|
dieWithoutRole([Roles::ROLE_ADDEDIT, Roles::ROLE_ADDHIST]);
|
|
|
|
|