summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/import.inc.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-04-07 13:14:00 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-04-07 13:14:00 +0000
commitd1f0507236793e1d4b28eb213b17432cef9bdd99 (patch)
treed6c07129b66ba6acb0cac47fab9a6bf5452e7b86 /frontends/php/include/import.inc.php
parent81c4d84a47e5d82758d45a83cd0b4b9cb35c7ea8 (diff)
downloadzabbix-d1f0507236793e1d4b28eb213b17432cef9bdd99.tar.gz
zabbix-d1f0507236793e1d4b28eb213b17432cef9bdd99.tar.xz
zabbix-d1f0507236793e1d4b28eb213b17432cef9bdd99.zip
- [DEV-137] improvements in permissions checks (Artem)
- [DEV-137] fixed issue "viewing items, hosts without group in latest data" (Artem) git-svn-id: svn://svn.zabbix.com/trunk@5595 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/import.inc.php')
-rw-r--r--frontends/php/include/import.inc.php19
1 files changed, 9 insertions, 10 deletions
diff --git a/frontends/php/include/import.inc.php b/frontends/php/include/import.inc.php
index 242f4871..0563cc37 100644
--- a/frontends/php/include/import.inc.php
+++ b/frontends/php/include/import.inc.php
@@ -36,13 +36,13 @@
$this->trigger = array('exist' => 0, 'missed' => 0);
$this->graph = array('exist' => 0, 'missed' => 0);
- $this->accessible_groups = get_accessible_groups_by_user($USER_DETAILS,
+ $this->available_groups = get_accessible_groups_by_user($USER_DETAILS,
PERM_READ_WRITE, null, PERM_RES_IDS_ARRAY, get_current_nodeid());
- $this->accessible_hosts = get_accessible_hosts_by_user($USER_DETAILS,
+ $this->available_hosts = get_accessible_hosts_by_user($USER_DETAILS,
PERM_READ_WRITE, null, PERM_RES_IDS_ARRAY, get_current_nodeid());
- $this->accessible_nodes = get_accessible_nodes_by_user($USER_DETAILS,
+ $this->available_nodes = get_accessible_nodes_by_user($USER_DETAILS,
PERM_READ_WRITE, null, PERM_RES_IDS_ARRAY, get_current_nodeid());
}
@@ -92,7 +92,7 @@
if($host_data = DBfetch(DBselect('select hostid from hosts'.
' where host='.zbx_dbstr($data['name']).
- ' and '.DBin_node('hostid',get_current_nodeid(false)))))
+ ' and '.DBin_node('hostid',get_current_nodeid(false)))))
{ /* exist */
if($this->host['exist']==1) /* skip */
{
@@ -100,7 +100,7 @@
info('Host ['.$data['name'].'] skipped - user rule');
break; // case
}
- if(!uint_in_array($host_data['hostid'], $this->accessible_hosts)){
+ if(!uint_in_array($host_data['hostid'], $this->available_hosts)){
error('Host ['.$data['name'].'] skipped - Access deny.');
break; // case
}
@@ -117,8 +117,8 @@
break; // case
}
-// if( count($this->accessible_nodes) > 0 ){
- if(!uint_in_array(get_current_nodeid(),$this->accessible_nodes)){
+// if( count($this->available_nodes) > 0 ){
+ if(!uint_in_array(get_current_nodeid(),$this->available_nodes)){
error('Host ['.$data['name'].'] skipped - Access deny.');
break; // case
}
@@ -183,7 +183,6 @@
global $USER_DETAILS;
$data = &$this->data[$name];
-
switch($name)
{
case XML_TAG_HOST:
@@ -243,7 +242,7 @@
break; // case
}
- if(!uint_in_array($group["groupid"], $this->accessible_groups))
+ if(!uint_in_array($group["groupid"], $this->available_groups))
{
error('Group ['.$this->element_data.'] skipped - Access deny.');
break; // case
@@ -287,7 +286,7 @@
break; // case
}
- if(!uint_in_array($template["hostid"], $this->accessible_hosts))
+ if(!uint_in_array($template["hostid"], $this->available_hosts))
{
error('Template ['.$this->element_data.'] skipped - Access deny.');
break; // case