summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/perm.inc.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-04-10 09:34:21 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-04-10 09:34:21 +0000
commitfcc91decd3db84a94505ac2147be987867dcfb41 (patch)
treeec0ba6b36bf92051aca7b5fbcc4e2d4e9a792c9b /frontends/php/include/perm.inc.php
parentd53a7572a565383d4680361388063acb0a864aaa (diff)
downloadzabbix-fcc91decd3db84a94505ac2147be987867dcfb41.tar.gz
zabbix-fcc91decd3db84a94505ac2147be987867dcfb41.tar.xz
zabbix-fcc91decd3db84a94505ac2147be987867dcfb41.zip
- merged rev. 5602:5604 of branches/1.4 (Artem) [fixed empty cells for IE]
- fixes permissions SQL for different DBs (Artem) git-svn-id: svn://svn.zabbix.com/trunk@5605 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/perm.inc.php')
-rw-r--r--frontends/php/include/perm.inc.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/frontends/php/include/perm.inc.php b/frontends/php/include/perm.inc.php
index e96b77bc..4c15b0f5 100644
--- a/frontends/php/include/perm.inc.php
+++ b/frontends/php/include/perm.inc.php
@@ -185,6 +185,7 @@
}
function get_accessible_hosts_by_user(&$user_data,$perm,$perm_mode=null,$perm_res=null,$nodeid=null,$cache=1){
+ global $DB_TYPE;
static $available_hosts;
if(is_null($perm_res)) $perm_res = PERM_RES_STRING_LINE;
@@ -228,6 +229,8 @@ COpt::counter_up('perm');
$where = ' where '.implode(' and ',$where);
else
$where = '';
+
+ $sortorder = (isset($DB_TYPE) && (($DB_TYPE == 'MYSQL') || ($DB_TYPE == 'SQLITE3')))?' DESC ':'';
$sql = 'SELECT DISTINCT n.nodeid,n.name as node_name,h.hostid,h.host, min(r.permission) as permission,ug.userid '.
' FROM hosts h '.
@@ -238,7 +241,7 @@ COpt::counter_up('perm');
' 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 '.$sortorder.', userid '.$sortorder;
$db_hosts = DBselect($sql);