diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-01 23:43:00 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-01 23:43:00 +0200 |
commit | bb07dde9881368f5727133b73f6017deae4ff18d (patch) | |
tree | d575bf34ed2d3db48658dcf1b53730cfa7431200 /lib/public | |
parent | 12976fb2e1f6a4d6a054ba2b620f0e7707ce2c69 (diff) | |
parent | c7770265063045a8de69f4171236ffe33a22c87e (diff) | |
download | nextcloud-server-bb07dde9881368f5727133b73f6017deae4ff18d.tar.gz nextcloud-server-bb07dde9881368f5727133b73f6017deae4ff18d.zip |
Merge branch 'master' into convert-oc_config
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/share.php | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/lib/public/share.php b/lib/public/share.php index 122ab3fa030..de7025d7b15 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -662,7 +662,13 @@ class Share { // Remove the permissions for all reshares of this item if (!empty($ids)) { $ids = "'".implode("','", $ids)."'"; - $query = \OC_DB::prepare('UPDATE `*PREFIX*share` SET `permissions` = `permissions` & ?' + // TODO this should be done with Doctrine platform objects + if (\OC_Config::getValue( "dbtype") === 'oci') { + $andOp = 'BITAND(`permissions`, ?)'; + } else { + $andOp = '`permissions` & ?'; + } + $query = \OC_DB::prepare('UPDATE `*PREFIX*share` SET `permissions` = '.$andOp .' WHERE `id` IN ('.$ids.')'); $query->execute(array($permissions)); } @@ -963,6 +969,30 @@ class Share { $switchedItems = array(); $mounts = array(); while ($row = $result->fetchRow()) { + if (isset($row['id'])) { + $row['id']=(int)$row['id']; + } + if (isset($row['share_type'])) { + $row['share_type']=(int)$row['share_type']; + } + if (isset($row['parent'])) { + $row['parent']=(int)$row['parent']; + } + if (isset($row['file_parent'])) { + $row['file_parent']=(int)$row['file_parent']; + } + if (isset($row['file_source'])) { + $row['file_source']=(int)$row['file_source']; + } + if (isset($row['permissions'])) { + $row['permissions']=(int)$row['permissions']; + } + if (isset($row['storage'])) { + $row['storage']=(int)$row['storage']; + } + if (isset($row['stime'])) { + $row['stime']=(int)$row['stime']; + } // Filter out duplicate group shares for users with unique targets if ($row['share_type'] == self::$shareTypeGroupUserUnique && isset($items[$row['parent']])) { $row['share_type'] = self::SHARE_TYPE_GROUP; @@ -978,7 +1008,7 @@ class Share { // Check if the same owner shared with the user twice // through a group and user share - this is allowed $id = $targets[$row[$column]]; - if ($items[$id]['uid_owner'] == $row['uid_owner']) { + if (isset($items[$id]) && $items[$id]['uid_owner'] == $row['uid_owner']) { // Switch to group share type to ensure resharing conditions aren't bypassed if ($items[$id]['share_type'] != self::SHARE_TYPE_GROUP) { $items[$id]['share_type'] = self::SHARE_TYPE_GROUP; |