diff --git a/html/user/host.inc b/html/user/host.inc
index d7b7cb714c..0401099c08 100644
--- a/html/user/host.inc
+++ b/html/user/host.inc
@@ -17,11 +17,16 @@ function location_form($host) {
return $x;
}
-function show_host($host, $private) {
+function show_host($host, $private, $ipprivate) {
start_table();
row1("Computer information");
if ($private) {
- row2("IP address", "$host->last_ip_addr
(same the last $host->nsame_ip_addr times)");
+ if ($ipprivate) {
+ row2("IP address", "$host->last_ip_addr
(same the last $host->nsame_ip_addr times)");
+ }
+ else {
+ row2("IP address", "id&private=1&ipprivate=1>Show IP address");
+ }
row2("Domain name", $host->domain_name);
$x = $host->timezone/3600;
row2("Time zone", "UTC - $x hours");
diff --git a/html/user/show_host_detail.php b/html/user/show_host_detail.php
index 2679badfd8..ea256523a8 100644
--- a/html/user/show_host_detail.php
+++ b/html/user/show_host_detail.php
@@ -7,6 +7,7 @@
db_init();
$hostid = $_GET["hostid"];
$private = $_GET["private"];
+ $ipprivate = $_GET["ipprivate"];
$result = mysql_query("select * from host where id = $hostid");
$host = mysql_fetch_object($result);
mysql_free_result($result);
@@ -22,6 +23,6 @@
}
page_head("Computer summary", $user);
- show_host($host, $private);
+ show_host($host, $private, $ipprivate);
page_tail();
?>