From 03e7348896906926fe1eac557b5ece09ac9c8b6c Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 15 Apr 2009 11:21:44 +0000 Subject: [PATCH] "fixing commit r26783/4 for mysql: using octal numbers with mysql leads to funny results: select 384 & 0400 --> 384 not 256=0400 --> converted 0400, 040 and 04 to 256, 32 and 4 for mysql" --- phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php b/phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php index 48f046c7d9..87938dbbd8 100644 --- a/phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php +++ b/phpgwapi/inc/class.sqlfs_stream_wrapper.inc.php @@ -1046,8 +1046,10 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper { $memberships[] = abs($gid); // sqlfs stores the gid's positiv } - $sql_read_acl = '((fs_mode & 04)=04 OR (fs_mode & 0400)=0400 AND fs_uid='.(int)egw_vfs::$user. - ' OR (fs_mode & 040)=040 AND fs_gid IN('.implode(',',$memberships).'))'; + // 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).'))'; } return $sql_read_acl; }