summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-12-28 13:44:14 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-12-28 13:44:14 +0000
commit1d60e86ae09578cbb684975403f52ce80eb42ed0 (patch)
treee3d5555b02254133ecf12e8ef7e30afb669bb406 /frontends/php/include
parent6742b51b998f18ff3ab0ba0fb78d4c30913ebf7e (diff)
downloadzabbix-1d60e86ae09578cbb684975403f52ce80eb42ed0.tar.gz
zabbix-1d60e86ae09578cbb684975403f52ce80eb42ed0.tar.xz
zabbix-1d60e86ae09578cbb684975403f52ce80eb42ed0.zip
- [ZBX-237] fixed problem importing/exporting data (Artem)
- [DEV-90] fixes SQL for pgsql (Artem) git-svn-id: svn://svn.zabbix.com/trunk@5207 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/export.inc.php14
-rw-r--r--frontends/php/include/import.inc.php15
-rw-r--r--frontends/php/include/perm.inc.php15
3 files changed, 22 insertions, 22 deletions
diff --git a/frontends/php/include/export.inc.php b/frontends/php/include/export.inc.php
index 3b851e4f..ee69e083 100644
--- a/frontends/php/include/export.inc.php
+++ b/frontends/php/include/export.inc.php
@@ -84,7 +84,9 @@
'show_triggers' => '',
'graphtype' => '',
'yaxismin' => '',
- 'yaxismax' => '')
+ 'yaxismax' => '',
+ 'show_legend' => '',
+ 'show_3d' => '')
),
XML_TAG_GRAPH_ELEMENT => array(
'attribures' => array(
@@ -168,7 +170,7 @@
}
foreach($map['elements'] as $db_name => $xml_name)
{
- if(empty($data[$db_name])) continue;
+ if(!isset($data[$db_name])) continue;
if(empty($xml_name)) $xml_name = $db_name;
zbx_xmlwriter_write_element ($memory, $xml_name, $data[$db_name]);
}
@@ -213,7 +215,7 @@
}
foreach($map['elements'] as $db_name => $xml_name)
{
- if(empty($data[$db_name])) continue;
+ if(!isset($data[$db_name])) continue;
if(empty($xml_name)) $xml_name = $db_name;
zbx_xmlwriter_write_element ($memory, $xml_name, $data[$db_name]);
@@ -242,7 +244,7 @@
}
foreach($map['elements'] as $db_name => $xml_name)
{
- if(empty($data[$db_name])) continue;
+ if(!isset($data[$db_name])) continue;
if(empty($xml_name)) $xml_name = $db_name;
zbx_xmlwriter_write_element ($memory, $xml_name, $data[$db_name]);
}
@@ -267,7 +269,7 @@
}
foreach($map['elements'] as $db_name => $xml_name)
{
- if(empty($data[$db_name])) continue;
+ if(!isset($data[$db_name])) continue;
if(empty($xml_name)) $xml_name = $db_name;
zbx_xmlwriter_write_element ($memory, $xml_name, $data[$db_name]);
}
@@ -300,7 +302,7 @@
}
foreach($map['elements'] as $db_name => $xml_name)
{
- if(empty($data[$db_name])) continue;
+ if(!isset($data[$db_name])) continue;
if(empty($xml_name)) $xml_name = $db_name;
zbx_xmlwriter_write_element ($memory, $xml_name, $data[$db_name]);
}
diff --git a/frontends/php/include/import.inc.php b/frontends/php/include/import.inc.php
index 571e2aff..d3d6a3c3 100644
--- a/frontends/php/include/import.inc.php
+++ b/frontends/php/include/import.inc.php
@@ -35,7 +35,7 @@
$this->item = array('exist' => 0, 'missed' => 0);
$this->trigger = array('exist' => 0, 'missed' => 0);
$this->graph = array('exist' => 0, 'missed' => 0);
-
+
$this->accessible_groups = get_accessible_groups_by_user($USER_DETAILS,
PERM_READ_WRITE, null, PERM_RES_IDS_ARRAY, get_current_nodeid());
@@ -117,7 +117,8 @@
break; // case
}
- if( count($this->accessible_nodes) > 0 ){
+// if( count($this->accessible_nodes) > 0 ){
+ if(!in_array(get_current_nodeid(),$this->accessible_nodes)){
error('Host ['.$data['name'].'] skipped - Access deny.');
break; // case
}
@@ -492,6 +493,8 @@
if(!isset($data['graphtype'])) $data['graphtype'] = 0;
if(!isset($data['yaxismin'])) $data['yaxismin'] = 0;
if(!isset($data['yaxismax'])) $data['yaxismax'] = 0;
+ if(!isset($data['show_legend'])) $data['show_legend'] = 0;
+ if(!isset($data['show_3d'])) $data['show_3d'] = 0;
if(!isset($data['items'])) $data['items'] = array();
if(!isset($this->data[XML_TAG_HOST]['hostid']) || !$this->data[XML_TAG_HOST]['hostid'])
@@ -536,8 +539,9 @@
$data['show_work_period'],
$data['show_triggers'],
$data['graphtype'],
+ $data['show_legend'],
+ $data['show_3d'],
$graph['templateid']);
-
DBexecute('delete from graphs_items where graphid='.$data['graphid']);
}
else
@@ -563,7 +567,10 @@
$data['yaxismax'],
$data['show_work_period'],
$data['show_triggers'],
- $data['graphtype']);
+ $data['graphtype'],
+ $data['show_legend'],
+ $data['show_3d']
+ );
}
foreach($data['items'] as $item)
diff --git a/frontends/php/include/perm.inc.php b/frontends/php/include/perm.inc.php
index 00d1f53f..5354e087 100644
--- a/frontends/php/include/perm.inc.php
+++ b/frontends/php/include/perm.inc.php
@@ -314,12 +314,6 @@ COpt::counter_up('perm');
$result= array();
- switch($perm_res)
- {
- case PERM_RES_DATA_ARRAY: $resdata = '$node_data'; break;
- default: $resdata = '$node_data["nodeid"]'; break;
- }
-
COpt::counter_up('perm_nodes['.$userid.','.$perm.','.$perm_mode.','.$perm_res.','.$nodeid.']');
COpt::counter_up('perm');
@@ -377,19 +371,16 @@ COpt::counter_up('perm');
}
/* special processing for PERM_READ_LIST*/
- if(PERM_DENY == $node_data['permission'] && PERM_READ_LIST == $perm)
- {
+ if(PERM_DENY == $node_data['permission'] && PERM_READ_LIST == $perm){
$groups = get_accessible_groups_by_user($user_data,
$perm, PERM_MODE_GE,PERM_RES_DATA_ARRAY,$node_data['nodeid']);
if(count($groups) == 0) continue;
}
- else
- {
+ else{
if(eval('return ('.$node_data["permission"].' '.perm_mode2comparator($perm_mode).' '.$perm.')? 0 : 1;'))
continue;
}
-
- $result[$node_data["nodeid"]] = eval('return '.$resdata.';');
+ $result[$node_data["nodeid"]]= ($perm_res == PERM_RES_DATA_ARRAY)?$node_data:$node_data["nodeid"];
}
if($perm_res == PERM_RES_STRING_LINE)