summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-08-02 12:23:31 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-08-02 12:23:31 +0000
commit78134fbc73c8f2f947722093fb1d625268a60552 (patch)
treeb84e3301b46e0a6054e8c2f55d34044050fa14b9 /frontends/php/include
parent3e5c8f13f71b5297f5c6621b7156e381606f06ac (diff)
downloadzabbix-78134fbc73c8f2f947722093fb1d625268a60552.tar.gz
zabbix-78134fbc73c8f2f947722093fb1d625268a60552.tar.xz
zabbix-78134fbc73c8f2f947722093fb1d625268a60552.zip
- merged rev. 4501:4502 of branches/1.4.2 (Eugene)
[ - added undefined element message 'No **** defined' instead 'Premission deny' (Eugene) - fixed items,graphs,hostgroups deletion (Eugene) - fixed permisions for maps (Eugene) ] git-svn-id: svn://svn.zabbix.com/trunk@4505 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/config.inc.php2
-rw-r--r--frontends/php/include/graphs.inc.php2
-rw-r--r--frontends/php/include/hosts.inc.php3
-rw-r--r--frontends/php/include/items.inc.php6
-rw-r--r--frontends/php/include/locales/en_gb.inc.php4
-rw-r--r--frontends/php/include/maps.inc.php10
6 files changed, 20 insertions, 7 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index e295a239..b60bacbb 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -283,7 +283,7 @@ function TODO($msg) { echo "TODO: ".$msg.BR; } // DEBUG INFO!!!
function fatal_error($msg)
{
include_once "include/page_header.php";
- error($msg);
+ show_error_message($msg);
include_once "include/page_footer.php";
}
diff --git a/frontends/php/include/graphs.inc.php b/frontends/php/include/graphs.inc.php
index c28f33cb..ddaebba5 100644
--- a/frontends/php/include/graphs.inc.php
+++ b/frontends/php/include/graphs.inc.php
@@ -516,6 +516,8 @@
return $result;
}
+ DBexecute('delete from screens_items where resourceid='.$graphid.' and resourcetype='.SCREEN_RESOURCE_GRAPH);
+
/* delete graph */
if ( ($result = DBexecute('DELETE FROM graphs_items WHERE graphid='.$graphid)) )
if ( ($result = DBexecute('DELETE FROM graphs WHERE graphid='.$graphid)) )
diff --git a/frontends/php/include/hosts.inc.php b/frontends/php/include/hosts.inc.php
index ed015f75..1edecfb4 100644
--- a/frontends/php/include/hosts.inc.php
+++ b/frontends/php/include/hosts.inc.php
@@ -408,8 +408,7 @@ require_once "include/items.inc.php";
$row2=DBfetch($result2);
if($row2["count"]==0)
{
- $sql="delete from groups where groupid=".$row["groupid"];
- DBexecute($sql);
+ delete_host_group($row["groupid"]);
}
}
}
diff --git a/frontends/php/include/items.inc.php b/frontends/php/include/items.inc.php
index 3232d384..d2a45d30 100644
--- a/frontends/php/include/items.inc.php
+++ b/frontends/php/include/items.inc.php
@@ -756,6 +756,12 @@
$result = delete_history_by_itemid($itemid, 1 /* use housekeeper */);
if(!$result) return $result;
+ DBexecute('delete from screens_items where resourceid='.$itemid.' and resourcetype in ('.
+ (implode(',',array(
+ SCREEN_RESOURCE_SIMPLE_GRAPH,
+ SCREEN_RESOURCE_PLAIN_TEXT)
+ )
+ ).')');
$result = DBexecute("delete from items_applications where itemid=$itemid");
if(!$result) return $result;
diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php
index 54c4eb6d..8c58604e 100644
--- a/frontends/php/include/locales/en_gb.inc.php
+++ b/frontends/php/include/locales/en_gb.inc.php
@@ -522,6 +522,7 @@
'S_ANOTHER_ITEM_SUM'=> 'Cannot add onemore item with type "Graph sum"',
'S_ID'=> 'Id',
'S_NO_GRAPHS_DEFINED'=> 'No graphs defined',
+ 'S_NO_GRAPH_DEFINED'=> 'No graph defined',
'S_DELETE_GRAPH_Q'=> 'Delete graph?',
'S_YAXIS_TYPE'=> 'Y axis type',
'S_YAXIS_MIN_VALUE'=> 'Y axis MIN value',
@@ -678,6 +679,7 @@
// items.php
'S_NO_ITEMS_DEFINED'=> 'No items defined',
+ 'S_NO_ITEM_DEFINED'=> 'No item defined',
'S_HISTORY_CLEANED'=> 'History cleaned',
'S_CLEAN_HISTORY_SELECTED_ITEMS'=> 'Clean history selected items',
'S_CLEAN_HISTORY'=> 'Clean history',
@@ -1062,6 +1064,7 @@
'S_IT_SERVICES'=> 'IT services',
'S_CONFIGURATION_OF_IT_SERVICES'=> 'Configuration of IT services',
'S_SERVICE_UPDATED'=> 'Service updated',
+ 'S_NO_IT_SERVICE_DEFINED'=> 'No IT service defined',
'S_CANNOT_UPDATE_SERVICE'=> 'Cannot update service',
'S_SERVICE_ADDED'=> 'Service added',
'S_CANNOT_ADD_SERVICE'=> 'Cannot add service',
@@ -1132,6 +1135,7 @@
// triggers.php
'S_NO_TRIGGER'=> 'No trigger',
'S_NO_TRIGGERS_DEFINED'=> 'No triggers defined',
+ 'S_NO_TRIGGER_DEFINED'=> 'No trigger defined',
'S_CONFIGURATION_OF_TRIGGERS'=> 'Configuration of triggers',
'S_CONFIGURATION_OF_TRIGGERS_BIG'=> 'CONFIGURATION OF TRIGGERS',
'S_DEPENDENCY_ADDED'=> 'Dependency added',
diff --git a/frontends/php/include/maps.inc.php b/frontends/php/include/maps.inc.php
index b4528584..ad1e6666 100644
--- a/frontends/php/include/maps.inc.php
+++ b/frontends/php/include/maps.inc.php
@@ -50,7 +50,8 @@
$result &= sysmap_accessiable($se_data['elementid'], PERM_READ_ONLY);
break;
case SYSMAP_ELEMENT_TYPE_TRIGGER:
- if(!DBfetch(DBselect("select distinct t.*".
+ if( DBfetch(DBselect('select triggerid from triggers where triggerid='.$se_data['elementid'])) &&
+ !DBfetch(DBselect("select distinct t.*".
" from triggers t,items i,functions f".
" where f.itemid=i.itemid and t.triggerid=f.triggerid".
" and i.hostid not in (".$denyed_hosts.") and t.triggerid=".$se_data['elementid'])))
@@ -58,9 +59,10 @@
$result = false;
}
break;
- case SYSMAP_ELEMENT_TYPE_HOST:
- if(in_array($se_data['elementid'],
- get_accessible_groups_by_user($USER_DETAILS,PERM_READ_ONLY, PERM_MODE_LT)))
+ case SYSMAP_ELEMENT_TYPE_HOST_GROUP:
+ if( DBfetch(DBselect('select groupid from groups where groupid='.$se_data['elementid'])) &&
+ in_array($se_data['elementid'],
+ get_accessible_groups_by_user($USER_DETAILS,PERM_READ_ONLY, PERM_MODE_LT, PERM_RES_IDS_ARRAY)))
{
$result = false;
}