summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/includes/restfunctions.php
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2019-10-11 13:24:57 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2019-10-11 13:45:15 +0200
commitde36dbe3e033896de9e9438f8db8f2af9251b4af (patch)
tree53a4242a992f3d9e100f02bf57408fd52b3e9a59 /admin/WebConsole/includes/restfunctions.php
parent0ff87c2b7b3e37ca9ff5f72e74a20d0019ad5e87 (diff)
#915 Fix POST "software" cmd in ogAdmServer and web
This patch adds the parameters "disk" and "partition" to POST "software" command. This way the client can create a software profile without failure. New request: POST /software { "clients":[ "192.168.56.12" ], "disk":"1", "partition":"1" } Reply: 200 OK
Diffstat (limited to 'admin/WebConsole/includes/restfunctions.php')
-rw-r--r--admin/WebConsole/includes/restfunctions.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/admin/WebConsole/includes/restfunctions.php b/admin/WebConsole/includes/restfunctions.php
index 717985dc..d27fdad0 100644
--- a/admin/WebConsole/includes/restfunctions.php
+++ b/admin/WebConsole/includes/restfunctions.php
@@ -472,11 +472,17 @@ function hardware($string_ips) {
common_request(OG_REST_CMD_HARDWARE, POST, $data);
}
-function software($string_ips) {
+function software($string_ips, $params) {
+
+ preg_match_all('/(?<=\=)(.*?)(?=\r)/', $params, $matches);
$ips = explode(';',$string_ips);
+ $disk = $matches[0][0];
+ $part = $matches[0][1];
- $data = array(OG_REST_PARAM_CLIENTS => $ips);
+ $data = array(OG_REST_PARAM_CLIENTS => $ips,
+ OG_REST_PARAM_DISK => $disk,
+ OG_REST_PARAM_PART => $part);
common_request(OG_REST_CMD_SOFTWARE, POST, $data);
}