diff options
author | Georg Ehrke <georg@ownCloud.com> | 2013-06-17 12:31:02 +0200 |
---|---|---|
committer | Georg Ehrke <georg@ownCloud.com> | 2013-06-17 12:31:02 +0200 |
commit | 1a933a91734be1057d54a6c24016b375bb4f36ed (patch) | |
tree | 2b0e8b113ca2da82448f9479933e646351aebc1a /lib/public | |
parent | 6082a0649cefd356370d4ca8034041c1af3875ff (diff) | |
parent | 6156d71832ee031d8d1f50d8dbff7d0bcfb45541 (diff) | |
download | nextcloud-server-1a933a91734be1057d54a6c24016b375bb4f36ed.tar.gz nextcloud-server-1a933a91734be1057d54a6c24016b375bb4f36ed.zip |
Merge branch 'master' into oc_preview
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/share.php | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/public/share.php b/lib/public/share.php index 81f5515bb4b..122ab3fa030 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -152,11 +152,11 @@ class Share { // Fetch all shares of this file path from DB $query = \OC_DB::prepare( - 'SELECT share_with + 'SELECT `share_with` FROM `*PREFIX*share` WHERE - item_source = ? AND share_type = ?' + `item_source` = ? AND `share_type` = ?' ); $result = $query->execute(array($source, self::SHARE_TYPE_USER)); @@ -171,11 +171,11 @@ class Share { // We also need to take group shares into account $query = \OC_DB::prepare( - 'SELECT share_with + 'SELECT `share_with` FROM `*PREFIX*share` WHERE - item_source = ? AND share_type = ?' + `item_source` = ? AND `share_type` = ?' ); $result = $query->execute(array($source, self::SHARE_TYPE_GROUP)); @@ -192,11 +192,11 @@ class Share { //check for public link shares if (!$publicShare) { $query = \OC_DB::prepare( - 'SELECT share_with + 'SELECT `share_with` FROM `*PREFIX*share` WHERE - item_source = ? AND share_type = ?' + `item_source` = ? AND `share_type` = ?' ); $result = $query->execute(array($source, self::SHARE_TYPE_LINK)); @@ -1586,10 +1586,10 @@ class Share { public static function post_removeFromGroup($arguments) { // TODO Don't call if user deleted? - $query = \OC_DB::prepare('SELECT `id`, `share_type` FROM `*PREFIX*share`' - .' WHERE (`share_type` = ? AND `share_with` = ?) OR (`share_type` = ? AND `share_with` = ?)'); - $result = $query->execute(array(self::SHARE_TYPE_GROUP, $arguments['gid'], self::$shareTypeGroupUserUnique, - $arguments['uid'])); + $sql = 'SELECT `id`, `share_type` FROM `*PREFIX*share`' + .' WHERE (`share_type` = ? AND `share_with` = ?) OR (`share_type` = ? AND `share_with` = ?)'; + $result = \OC_DB::executeAudited($sql, array(self::SHARE_TYPE_GROUP, $arguments['gid'], + self::$shareTypeGroupUserUnique, $arguments['uid'])); while ($item = $result->fetchRow()) { if ($item['share_type'] == self::SHARE_TYPE_GROUP) { // Delete all reshares by this user of the group share @@ -1601,8 +1601,8 @@ class Share { } public static function post_deleteGroup($arguments) { - $query = \OC_DB::prepare('SELECT id FROM `*PREFIX*share` WHERE `share_type` = ? AND `share_with` = ?'); - $result = $query->execute(array(self::SHARE_TYPE_GROUP, $arguments['gid'])); + $sql = 'SELECT `id` FROM `*PREFIX*share` WHERE `share_type` = ? AND `share_with` = ?'; + $result = \OC_DB::executeAudited($sql, array(self::SHARE_TYPE_GROUP, $arguments['gid'])); while ($item = $result->fetchRow()) { self::delete($item['id']); } |