summaryrefslogtreecommitdiffstats
path: root/frontends/php/sysmaps.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-04-14 13:26:42 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-04-14 13:26:42 +0000
commit5348f67b28ed1da2539db6de7a11c605a5dc3a57 (patch)
tree4646832d5a7263dbe6818409d9ce9e9dff419008 /frontends/php/sysmaps.php
parentc44eed92d3f3bcfc0efad6e18e31323f089a9ce6 (diff)
- [DEV-142] added transactions to DB actions (beta) (Artem)
- [DEV-137] improvements in permission checks (Artem) - [DEV-137] changes in schema (Artem) git-svn-id: svn://svn.zabbix.com/trunk@5619 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/sysmaps.php')
-rw-r--r--frontends/php/sysmaps.php37
1 files changed, 20 insertions, 17 deletions
diff --git a/frontends/php/sysmaps.php b/frontends/php/sysmaps.php
index db840693..abe5a767 100644
--- a/frontends/php/sysmaps.php
+++ b/frontends/php/sysmaps.php
@@ -64,24 +64,27 @@ include_once "include/page_header.php";
}
?>
<?php
- if(isset($_REQUEST["save"]))
- {
- if(isset($_REQUEST["sysmapid"]))
- {
+ if(isset($_REQUEST["save"])){
+ if(isset($_REQUEST["sysmapid"])){
// TODO check permission by new value.
- $result=update_sysmap($_REQUEST["sysmapid"],$_REQUEST["name"],$_REQUEST["width"],
+ DBstart();
+ update_sysmap($_REQUEST["sysmapid"],$_REQUEST["name"],$_REQUEST["width"],
$_REQUEST["height"],$_REQUEST["backgroundid"],$_REQUEST["label_type"],
$_REQUEST["label_location"]);
-
+ $result = DBend();
+
add_audit_if($result,AUDIT_ACTION_UPDATE,AUDIT_RESOURCE_MAP,'Name ['.$_REQUEST['name'].']');
show_messages($result,"Network map updated","Cannot update network map");
- } else {
+ }
+ else {
if(count(get_accessible_nodes_by_user($USER_DETAILS,PERM_READ_WRITE,PERM_MODE_LT,PERM_RES_IDS_ARRAY,get_current_nodeid())))
access_deny();
-
- $result=add_sysmap($_REQUEST["name"],$_REQUEST["width"],$_REQUEST["height"],
+
+ DBstart();
+ add_sysmap($_REQUEST["name"],$_REQUEST["width"],$_REQUEST["height"],
$_REQUEST["backgroundid"],$_REQUEST["label_type"],$_REQUEST["label_location"]);
-
+ $result = DBend();
+
add_audit_if($result,AUDIT_ACTION_ADD,AUDIT_RESOURCE_MAP,'Name ['.$_REQUEST['name'].']');
show_messages($result,"Network map added","Cannot add network map");
}
@@ -89,9 +92,11 @@ include_once "include/page_header.php";
unset($_REQUEST["form"]);
}
}
- elseif(isset($_REQUEST["delete"])&&isset($_REQUEST["sysmapid"]))
- {
- $result = delete_sysmap($_REQUEST["sysmapid"]);
+ else if(isset($_REQUEST["delete"])&&isset($_REQUEST["sysmapid"])){
+ DBstart();
+ delete_sysmap($_REQUEST["sysmapid"]);
+ $result = DBend();
+
add_audit_if($result,AUDIT_ACTION_DELETE,AUDIT_RESOURCE_MAP,'Name ['.$sysmap['name'].']');
show_messages($result,"Network map deleted","Cannot delete network map");
if($result){
@@ -108,12 +113,10 @@ include_once "include/page_header.php";
echo SBR;
?>
<?php
- if(isset($_REQUEST["form"]))
- {
+ if(isset($_REQUEST["form"])){
insert_map_form();
}
- else
- {
+ else{
show_table_header(S_MAPS_BIG);
$table = new CTableInfo(S_NO_MAPS_DEFINED);
$table->SetHeader(array(