summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-10-17 00:16:37 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-10-17 00:16:37 +0200
commit8cd268fc8284e96277eeb8555d45b0dac101fd67 (patch)
tree6e9f878e70eb49f9f4344d91bae5e8afbd364b4d /lib/public
parent102dd1242e3a6bdae85892b808ab82ec41e21a6b (diff)
parent1c3a36a079914f981eac5b5434d7e9e984748af0 (diff)
downloadnextcloud-server-8cd268fc8284e96277eeb8555d45b0dac101fd67.tar.gz
nextcloud-server-8cd268fc8284e96277eeb8555d45b0dac101fd67.zip
Merge branch 'master' of github.com:owncloud/core into vcategories_db
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/share.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index faa44d74735..d27802b52f7 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -327,6 +327,22 @@ class Share {
}
/**
+ * @brief Unshare an item from all users, groups, and remove all links
+ * @param string Item type
+ * @param string Item source
+ * @return Returns true on success or false on failure
+ */
+ public static function unshareAll($itemType, $itemSource) {
+ if ($shares = self::getItemShared($itemType, $itemSource)) {
+ foreach ($shares as $share) {
+ self::delete($share['id']);
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
* @brief Unshare an item shared with the current user
* @param string Item type
* @param string Item target