From fa2b1244f6f48a7961e44eefdcf9cf0f3797ba80 Mon Sep 17 00:00:00 2001 From: José Alberto Royo Ratia Date: Mon, 28 Sep 2020 11:39:02 +0200 Subject: #1005 Add support for computer groups in RemotePC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When OpenGnsys is used via RemotePC, a failure occurs when classrooms with groups of computers are included because the processing and recursion is not controlled correctly because attempts are made to add objects to a null array. This commit adds and populates an array with the computers in the group. Reviewed-by: Javier Sánchez Parra --- admin/WebConsole/rest/server.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/admin/WebConsole/rest/server.php b/admin/WebConsole/rest/server.php index c55d6709..c7c153ad 100644 --- a/admin/WebConsole/rest/server.php +++ b/admin/WebConsole/rest/server.php @@ -407,6 +407,10 @@ EOD; $tmp['name'] = $rs->campos["nombreaula"]; $tmp['inremotepc'] = ($rs->campos["inremotepc"] == 1); $tmp['group']['id'] = (int)$rs->campos["grupoid"]; + $tmp['classroomGroups'] = array(); + if (isset($rs->campos["nombregrupoordenador"])){ + $tmp['classroomGroups'] = array(array("id" => (int)$rs->campos["group_id"], "name" => $rs->campos["nombregrupoordenador"], "comments" => $rs->campos["comentarios"], "classroomGroups" => array())); + } $tmp['ou']['id'] = (int)$ouid; array_push($response, $tmp); } -- cgit v1.2.3-18-g5258