diff --git a/hook.php b/hook.php index 9a4b591..9e7ce8b 100644 --- a/hook.php +++ b/hook.php @@ -43,18 +43,19 @@ function plugin_remotesupport_postinit() { $requester = $row['users_id']; // select id, name, users_id from glpi_computers where users_id = 178; - $req2 = $DB->request(['FROM' => 'glpi_computers', 'WHERE' => ['users_id' => $requester]]); - $url = ""; - - while ($row2 = $req2->next()){ - $url .= "
  • " . $row2['name'] . "
  • "; - } - - if ($url != ""){ - echo "
    "; - } + if ($row['users_id'] != 0) { + $req2 = $DB->request(['FROM' => 'glpi_computers', 'WHERE' => ['users_id' => $requester]]); + $url = ""; + + while ($row2 = $req2->next()){ + $url .= "
  • "; + } + } } } ?>