summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/dbi.h1
-rw-r--r--src/rest.c17
2 files changed, 12 insertions, 6 deletions
diff --git a/src/dbi.h b/src/dbi.h
index 3b88861..37ecf2b 100644
--- a/src/dbi.h
+++ b/src/dbi.h
@@ -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;
diff --git a/src/rest.c b/src/rest.c
index bf2e1e5..75a4782 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -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);