diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dbi.h | 1 | ||||
-rw-r--r-- | src/rest.c | 17 |
2 files changed, 12 insertions, 6 deletions
@@ -82,6 +82,7 @@ struct og_computer { unsigned int repo_id; unsigned int center; unsigned int room; + unsigned int folder_id; unsigned int id; bool maintenance; bool remote; @@ -2130,6 +2130,11 @@ static int og_cmd_post_client_add(json_t *element, sizeof(computer.serial_number)); } else if (!strcmp(key, "hardware_id")) { err = og_json_parse_uint(value, &computer.hardware_id); + } else if (!strcmp(key, "folder_id")) { + err = og_json_parse_uint(value, &computer.folder_id); + if (!err) + computer.folder_id = computer.folder_id & 0x0000ffff; + } else if (!strcmp(key, "netdriver")) { err = og_json_parse_string_copy(value, computer.netdriver, @@ -2221,16 +2226,16 @@ static int og_cmd_post_client_add(json_t *element, " oglivedir," " inremotepc," " maintenance" - ") VALUES ('%s', '%s', '%s', '%s', %u, 0, %u," + ") VALUES ('%s', '%s', '%s', '%s', %u, %u, %u," " %u, '%s', '%s', '%s', '%s'," " '%s', %u, %u)", computer.name, computer.serial_number, computer.ip, computer.mac, computer.room, - computer.hardware_id, computer.repo_id, - computer.netmask, computer.boot, - computer.netiface, computer.netdriver, - computer.livedir, computer.remote, - computer.maintenance); + computer.folder_id, computer.hardware_id, + computer.repo_id, computer.netmask, + computer.boot, computer.netiface, + computer.netdriver, computer.livedir, + computer.remote, computer.maintenance); if (!result) { dbi_conn_error(dbi->conn, &msglog); |