summaryrefslogtreecommitdiffstats
path: root/frontends/php/hosts.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-09-17 18:44:38 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-09-17 18:44:38 +0000
commit44e8cd98347176a8c79a470c5a0b7e6d236991e0 (patch)
treeb7de8456d8ba825b5f2ecf6709b3bf6c92bfe9f9 /frontends/php/hosts.php
parent533fdf87666ac5d41102867b8c466324bf23252c (diff)
downloadzabbix-44e8cd98347176a8c79a470c5a0b7e6d236991e0.tar.gz
zabbix-44e8cd98347176a8c79a470c5a0b7e6d236991e0.tar.xz
zabbix-44e8cd98347176a8c79a470c5a0b7e6d236991e0.zip
Improvements for audit.
git-svn-id: svn://svn.zabbix.com/trunk@1427 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/hosts.php')
-rw-r--r--frontends/php/hosts.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php
index 65f86cb0..d7d08f4d 100644
--- a/frontends/php/hosts.php
+++ b/frontends/php/hosts.php
@@ -43,6 +43,8 @@
{
$result=add_host($_GET["host"],$_GET["port"],$_GET["status"],$_GET["useip"],$_GET["ip"],$_GET["host_templateid"],$_GET["newgroup"],$_GET["groups"]);
show_messages($result, S_HOST_ADDED, S_CANNOT_ADD_HOST);
+ if($result)
+ add_audit(AUDIT_ACTION_ADD,AUDIT_RESOURCE_HOST,"Host [".addslashes($_GET["host"])."] IP [".$_GET["ip"]."] Status [".$_GET["status"]."]");
unset($_GET["hostid"]);
}
if($_GET["register"]=="add items from template")
@@ -55,12 +57,19 @@
{
$result=@update_host($_GET["hostid"],$_GET["host"],$_GET["port"],$_GET["status"],$_GET["useip"],$_GET["ip"],$_GET["newgroup"],$_GET["groups"]);
show_messages($result, S_HOST_UPDATED, S_CANNOT_UPDATE_HOST);
+ if($result)
+ add_audit(AUDIT_ACTION_UPDATE,AUDIT_RESOURCE_HOST,"Host [".addslashes($_GET["host"])."] IP [".$_GET["ip"]."] Status [".$_GET["status"]."]");
unset($_GET["hostid"]);
}
if($_GET["register"]=="changestatus")
{
+ $host=get_host_by_hostid($_GET["hostid"]);
$result=update_host_status($_GET["hostid"],$_GET["status"]);
show_messages($result,S_HOST_STATUS_UPDATED,S_CANNOT_UPDATE_HOST_STATUS);
+ if($result)
+ {
+ add_audit(AUDIT_ACTION_UPDATE,AUDIT_RESOURCE_HOST,"Old status [".$host["status"]."] New status [$status]");
+ }
unset($_GET["hostid"]);
}
if($_GET["register"]=="delete")