From 5cbc182ac4024d0726c6b33b0e3db8fe2cf45207 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 28 Jun 2012 16:37:43 +0000 Subject: [PATCH] create valid SQL, even if account has for whaterver reason no group-memberships --- phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php b/phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php index ac2a8abbba..f2ec98595d 100644 --- a/phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php +++ b/phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php @@ -1183,7 +1183,8 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper // using octal numbers with mysql leads to funny results (select 384 & 0400 --> 384 not 256=0400) // 256 = 0400, 32 = 040 $sql_read_acl = '((fs_mode & 4)=4 OR (fs_mode & 256)=256 AND fs_uid='.(int)egw_vfs::$user. - ' OR (fs_mode & 32)=32 AND fs_gid IN('.implode(',',$memberships).'))'; + ($memberships ? ' OR (fs_mode & 32)=32 AND fs_gid IN('.implode(',',$memberships).')' : '').')'; + //error_log(__METHOD__."() egw_vfs::\$user=".array2string(egw_vfs::$user).' --> memberships='.array2string($memberships).' --> '.$sql_read_acl.($memberships?'':': '.function_backtrace())); } return $sql_read_acl; }