aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-07-14 11:55:22 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-07-14 11:55:22 -0400
commitcc6c940b9ab814b6674a36b218b1be26e94a26bd (patch)
tree451a24c950cce8fd76e89903c8aa64642f989675 /lib
parent82dea705d48f192cdeae942753141f3ea7770721 (diff)
downloadnextcloud-server-cc6c940b9ab814b6674a36b218b1be26e94a26bd.tar.gz
nextcloud-server-cc6c940b9ab814b6674a36b218b1be26e94a26bd.zip
Implement post_removeFromGroup()
Diffstat (limited to 'lib')
-rw-r--r--lib/public/share.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index 50f2ff1c8a2..b1f7468c83e 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -761,7 +761,16 @@ class Share {
}
public static function post_removeFromGroup($arguments) {
- // TODO
+ $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']));
+ while ($item = $result->fetchRow()) {
+ if ($item['share_type'] == self::SHARE_TYPE_GROUP) {
+ // Delete all reshares by this user of the group share
+ self::delete($item['id'], true, $arguments['uid']);
+ } else {
+ self::delete($item['id']);
+ }
+ }
}
}