summaryrefslogtreecommitdiffstats
path: root/lib/public/share.php
diff options
context:
space:
mode:
authorMorris Jobke <morris.jobke@gmail.com>2013-10-18 11:37:13 +0200
committerMorris Jobke <morris.jobke@gmail.com>2013-10-18 11:37:13 +0200
commit1f1fcc61298e1ce8b32a16824da0e44671bb30f5 (patch)
tree3f058237b69c4209b44b980a39ac0d6f3055d196 /lib/public/share.php
parent0febccee49faa63beff1de253957a193a904fd4a (diff)
downloadnextcloud-server-1f1fcc61298e1ce8b32a16824da0e44671bb30f5.tar.gz
nextcloud-server-1f1fcc61298e1ce8b32a16824da0e44671bb30f5.zip
Remove "link" shares right after disabling the "allow_link_share" setting
Diffstat (limited to 'lib/public/share.php')
-rw-r--r--lib/public/share.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/public/share.php b/lib/public/share.php
index 2847f9e5ec9..59150e1964f 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -1722,6 +1722,18 @@ class Share {
}
/**
+ * Delete all shares with type SHARE_TYPE_LINK
+ */
+ public static function removeAllLinkShares() {
+ // Delete any link shares
+ $query = \OC_DB::prepare('SELECT `id` FROM `*PREFIX*share` WHERE `share_type` = ?');
+ $result = $query->execute(array(self::SHARE_TYPE_LINK));
+ while ($item = $result->fetchRow()) {
+ self::delete($item['id']);
+ }
+ }
+
+ /**
* Hook Listeners
*/