summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/perm.inc.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-11-02 09:49:44 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-11-02 09:49:44 +0000
commit053e091380bdeff1d9a423e1dfdcfcda396045d5 (patch)
treeda06e467138936e3cd12ee6db4c73e677c305a76 /frontends/php/include/perm.inc.php
parent467c2281b799cf57a72682097fbeb7caa7d1faae (diff)
downloadzabbix-053e091380bdeff1d9a423e1dfdcfcda396045d5.tar.gz
zabbix-053e091380bdeff1d9a423e1dfdcfcda396045d5.tar.xz
zabbix-053e091380bdeff1d9a423e1dfdcfcda396045d5.zip
- [ZBX-134] merged rev. 4956:4966 of branches/1.4/ (Artem) (fixes for hostid/groupid validation on Node switch)
git-svn-id: svn://svn.zabbix.com/trunk@4968 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/perm.inc.php')
-rw-r--r--frontends/php/include/perm.inc.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/frontends/php/include/perm.inc.php b/frontends/php/include/perm.inc.php
index f92da482..7dbdbf8c 100644
--- a/frontends/php/include/perm.inc.php
+++ b/frontends/php/include/perm.inc.php
@@ -162,14 +162,16 @@ COpt::counter_up('perm');
if(count($where)) $where = ' where '.implode(' and ',$where);
else $where = '';
- $db_hosts = DBselect('select distinct n.nodeid,n.name as node_name,h.hostid,h.host, min(r.permission) as permission,ug.userid '.
+ $sql = 'select distinct n.nodeid,n.name as node_name,h.hostid,h.host, min(r.permission) as permission,ug.userid '.
' from hosts h left join hosts_groups hg on hg.hostid=h.hostid '.
' left join groups g on g.groupid=hg.groupid '.
' left join rights r on r.id=g.groupid and r.type='.RESOURCE_TYPE_GROUP.
' left join users_groups ug on ug.usrgrpid=r.groupid and ug.userid='.$userid.
' left join nodes n on '.DBid2nodeid('h.hostid').'=n.nodeid '.
$where.' group by h.hostid,n.nodeid,n.name,h.host,ug.userid '.
- ' order by n.name,n.nodeid, h.host, permission desc, userid desc');
+ ' order by n.name,n.nodeid, h.host, permission desc, userid desc';
+
+ $db_hosts = DBselect($sql);
$processed = array();
while($host_data = DBfetch($db_hosts))