From 984e8708f85679aefd3d0029383e8fefbaf647a0 Mon Sep 17 00:00:00 2001 From: hugetoad Date: Sat, 18 Sep 2004 08:15:56 +0000 Subject: Better audit support. git-svn-id: svn://svn.zabbix.com/trunk@1428 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/graph.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'frontends/php/graph.php') diff --git a/frontends/php/graph.php b/frontends/php/graph.php index ac090c7f..36f72f71 100644 --- a/frontends/php/graph.php +++ b/frontends/php/graph.php @@ -45,16 +45,36 @@ if($_GET["register"]=="add") { $result=add_item_to_graph($_GET["graphid"],$_GET["itemid"],$_GET["color"],$_GET["drawtype"],$_GET["sortorder"]); + if($result) + { + $graph=get_graph_by_graphid($_GET["graphid"]); + $item=get_item_by_itemid($_GET["itemid"]); + add_audit(AUDIT_ACTION_ADD,AUDIT_RESOURCE_GRAPH_ELEMENT,"Graph ID [".$_GET["graphid"]."] Name [".$graph["name"]."] Added [".$item["name"]."]"); + } show_messages($result,S_ITEM_ADDED, S_CANNOT_ADD_ITEM); } if($_GET["register"]=="update") { $result=update_graph_item($_GET["gitemid"],$_GET["itemid"],$_GET["color"],$_GET["drawtype"],$_GET["sortorder"]); + if($result) + { + $graphitem=get_graphitem_by_gitemid($_GET["gitemid"]); + $graph=get_graph_by_graphid($graphitem["graphid"]); + $item=get_item_by_itemid($graphitemid["itemid"]); + add_audit(AUDIT_ACTION_UPDATE,AUDIT_RESOURCE_GRAPH_ELEMENT,"Graph ID [".$graphitem["graphid"]."] Name [".$graph["name"]."] Updated [".$item["name"]."]"); + } show_messages($result, S_ITEM_UPDATED, S_CANNOT_UPDATE_ITEM); } if($_GET["register"]=="delete") { + $graphitem=get_graphitem_by_gitemid($_GET["gitemid"]); $result=delete_graphs_item($_GET["gitemid"]); + if($result) + { + $graph=get_graph_by_graphid($graphitem["graphid"]); + $item=get_item_by_itemid($graphitemid["itemid"]); + add_audit(AUDIT_ACTION_DELETE,AUDIT_RESOURCE_GRAPH_ELEMENT,"Graph ID [".$graphitem["graphid"]."] Name [".$graph["name"]."] Deleted [".$item["name"]."]"); + } show_messages($result, S_ITEM_DELETED, S_CANNOT_DELETE_ITEM); unset($_GET["gitemid"]); } -- cgit