Merge pull request #2 from MC-brunomendes/main

Fix if user doesn't exists
This commit is contained in:
Kaya84
2021-11-20 20:17:52 +01:00
committed by GitHub

View File

@@ -43,12 +43,12 @@ function plugin_remotesupport_postinit() {
$requester = $row['users_id'];
// select id, name, users_id from glpi_computers where users_id = 178;
if ($row['users_id'] != 0) {
$req2 = $DB->request(['FROM' => 'glpi_computers', 'WHERE' => ['users_id' => $requester]]);
$url = "";
while ($row2 = $req2->next()){
$url .= "<li class=\"document\" onclick=\"location.href='vnc://" . $row2['name'] ."'\"><i class=\"fa fa-laptop-medical\"></i>" . $row2['name'] . "</li>";
}
$url .= "<li class=\"document\" onclick=\"location.href='vnc://" . $row2['name'] ."'\"$ }
if ($url != ""){
echo "<div><ul class=\"timeline_choices\"><h2>Remote support : </h2>";
@@ -57,4 +57,5 @@ function plugin_remotesupport_postinit() {
}
}
}
}
?>