diff --git a/inc/remote_status.php b/inc/remote_status.php index 768bbe9..1d11426 100644 --- a/inc/remote_status.php +++ b/inc/remote_status.php @@ -111,20 +111,17 @@ print_r($states_ids); [ '1' => '1' ] ); - +$ids = []; foreach ($checked as $s) { - echo $s->computers_id." "; - - $comp = new Computer(); - $comp->getFromDB($s->computers_id); - $comp->fields["states_id"] = $states_ids["Online"]; - $DB->update("glpi_computers", [ - 'states_id' => $comp->fields["states_id"] ], - [ 'id' => $s->computers_id ] - ); - echo $comp->fields["contact"]."\n"; - + echo $s->computers_id."\n"; + $ids[] = $s->computers_id; } +$DB->update("glpi_computers", [ + 'states_id' => $states_ids["Online"] ], + [ 'id' => $ids ] +); + + // print_r($a_computerextend); exit(0); diff --git a/remotesupport.xml b/remotesupport.xml index cc0cd3e..bdfa284 100644 --- a/remotesupport.xml +++ b/remotesupport.xml @@ -21,7 +21,7 @@ - 0.0.1 + 0.0.2 ~9.5.0