diff options
author | Javier Sánchez Parra <jsanchez@soleta.eu> | 2019-06-11 11:39:08 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2019-06-11 11:50:52 +0200 |
commit | e378505f1144b6537cd605c549af84f452eee6e2 (patch) | |
tree | b2cd7913f99944664bb59ae794474f8e81037bf3 /admin/WebConsole/includes | |
parent | 25d4404fde54af8a926d0e0b6fdebfc38ac7feab (diff) |
#915 The order of the json field is irrelevant in GET /clients
Either:
{ "addr" : "192.168.2.1", "state" : "OPG" }
or:
{ "state" : "OPG", "addr" : "192.168.2.1" }
should be accepted, this patch updates the web console parser to accept
both.
Diffstat (limited to 'admin/WebConsole/includes')
-rw-r--r-- | admin/WebConsole/includes/restfunctions.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/admin/WebConsole/includes/restfunctions.php b/admin/WebConsole/includes/restfunctions.php index 6073bdef..1650691e 100644 --- a/admin/WebConsole/includes/restfunctions.php +++ b/admin/WebConsole/includes/restfunctions.php @@ -23,6 +23,7 @@ define('OG_REST_PARAM_DISK', 'disk'); define('OG_REST_PARAM_PART', 'partition'); define('OG_REST_PARAM_RUN', 'run'); define('OG_REST_PARAM_TYPE', 'type'); +define('OG_REST_PARAM_STATE', 'state'); function common_request($command, $type, $data = null, $custom = 'GET') { @@ -95,7 +96,8 @@ function clients($case, $ips) { $result = common_request(OG_REST_CMD_CLIENTS, $type, $data); foreach ($result[OG_REST_PARAM_CLIENTS] as $client) { - $trama_notificacion = $trama_notificacion.implode('/', $client).';'; + $trama_notificacion = $trama_notificacion.$client[OG_REST_PARAM_ADDR].'/'. + $client[OG_REST_PARAM_STATE].';'; } return $trama_notificacion; |