summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/import.inc.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-08-13 08:22:32 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-08-13 08:22:32 +0000
commitabaab90a1c9d3367f1ef636557cfe8e661716749 (patch)
tree3e266e5523a635c45a7e7ef6d4571e7323f26065 /frontends/php/include/import.inc.php
parent8901654871973b4267f106a97183001189189c82 (diff)
downloadzabbix-abaab90a1c9d3367f1ef636557cfe8e661716749.tar.gz
zabbix-abaab90a1c9d3367f1ef636557cfe8e661716749.tar.xz
zabbix-abaab90a1c9d3367f1ef636557cfe8e661716749.zip
- merger rev. 4546:4547 of branches/1.4.j [developed data monitoring of multiple nodes]
git-svn-id: svn://svn.zabbix.com/trunk@4549 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/import.inc.php')
-rw-r--r--frontends/php/include/import.inc.php25
1 files changed, 11 insertions, 14 deletions
diff --git a/frontends/php/include/import.inc.php b/frontends/php/include/import.inc.php
index e9f9349f..fe18026d 100644
--- a/frontends/php/include/import.inc.php
+++ b/frontends/php/include/import.inc.php
@@ -25,7 +25,7 @@
{
function CZabbixXMLImport()
{
- global $USER_DETAILS, $ZBX_CURNODEID;
+ global $USER_DETAILS;
$this->main_node= null;
$this->sub_node = null;
@@ -37,13 +37,13 @@
$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, $ZBX_CURNODEID);
+ PERM_READ_WRITE, null, PERM_RES_IDS_ARRAY, get_current_nodeid());
$this->accessible_hosts = get_accessible_hosts_by_user($USER_DETAILS,
- PERM_READ_WRITE, null, PERM_RES_IDS_ARRAY, $ZBX_CURNODEID);
+ PERM_READ_WRITE, null, PERM_RES_IDS_ARRAY, get_current_nodeid());
$this->accessible_nodes = get_accessible_nodes_by_user($USER_DETAILS,
- PERM_READ_WRITE, null, PERM_RES_IDS_ARRAY, $ZBX_CURNODEID);
+ PERM_READ_WRITE, null, PERM_RES_IDS_ARRAY, get_current_nodeid());
}
function CharacterData($parser, $data)
@@ -76,8 +76,6 @@
return false;
}
- global $ZBX_CURNODEID;
-
$data = &$this->data[$name];
foreach($attrs as $id => $val)
@@ -94,7 +92,7 @@
if($host_data = DBfetch(DBselect('select hostid from hosts'.
' where host='.zbx_dbstr($data['name']).
- ' and '.DBid2nodeid('hostid').'='.$ZBX_CURNODEID)))
+ ' and '.DBin_node('hostid',get_current_nodeid(false)))))
{ /* exist */
if($this->host['exist']==1) /* skip */
{
@@ -119,7 +117,7 @@
break; // case
}
- if(!in_array($ZBX_CURNODEID, $this->accessible_nodes)){
+ if( count($this->accessible_nodes) > 0 ){
error('Host ['.$data['name'].'] skipped - Access deny.');
break; // case
}
@@ -180,7 +178,6 @@
}
global $USER_DETAILS;
- global $ZBX_CURNODEID;
$data = &$this->data[$name];
@@ -208,7 +205,7 @@
break; //case
if(!($group = DBfetch(DBselect('select groupid, name from groups'.
- ' where '.DBid2nodeid('groupid').'='.$ZBX_CURNODEID.
+ ' where '.DBin_node('groupid',get_current_nodeid(false)).
' and name='.zbx_dbstr($this->element_data)))))
{
error('Missed group ['.$this->element_data.']');
@@ -232,7 +229,7 @@
break; //case
if(!($application = DBfetch(DBselect('select applicationid from applications'.
- ' where '.DBid2nodeid('applicationid').'='.$ZBX_CURNODEID.
+ ' where '.DBin_node('applicationid',get_current_nodeid(false)).
' and name='.zbx_dbstr($this->element_data).
' and hostid='.$this->data[XML_TAG_HOST]['hostid']))))
{
@@ -252,7 +249,7 @@
if(!($template = DBfetch(DBselect('SELECT DISTINCT host, hostid '.
' FROM hosts'.
- ' WHERE '.DBid2nodeid('hostid').'='.$ZBX_CURNODEID.
+ ' WHERE '.DBin_node('hostid').
' AND host='.zbx_dbstr($this->element_data)))))
{
error('Missed template ['.$this->element_data.']');
@@ -307,7 +304,7 @@
if(!empty($data['valuemap']))
{
if( $valuemap = DBfetch(DBselect('select valuemapid from valuemaps '.
- ' where '.DBid2nodeid('valuemapid').'='.$ZBX_CURNODEID.
+ ' where '.DBin_node('valuemapid', get_current_nodeid(false)).
' and name='.zbx_dbstr($data['valuemap']))) )
{
$data['valuemapid'] = $valuemap['valuemapid'];
@@ -321,7 +318,7 @@
if($item = DBfetch(DBselect('select itemid,valuemapid,templateid from items'.
' where key_='.zbx_dbstr($data['key']).
' and hostid='.$this->data[XML_TAG_HOST]['hostid'].' and '.
- DBid2nodeid('itemid').'='.$ZBX_CURNODEID)))
+ DBin_node('itemid', get_current_nodeid(false)))))
{ /* exist */
if($this->item['exist']==1) /* skip */
{