diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2013-10-02 13:26:38 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2013-10-02 13:26:38 +0200 |
commit | aa660a347563c29cdfc0e4b5af8ff9f18e923a13 (patch) | |
tree | a2544588d6093ab64d83fee11cedb2fda8fc83ea /apps | |
parent | 535ed8369f701a184340a428e82cc8d7cc7588bb (diff) | |
download | nextcloud-server-aa660a347563c29cdfc0e4b5af8ff9f18e923a13.tar.gz nextcloud-server-aa660a347563c29cdfc0e4b5af8ff9f18e923a13.zip |
remove deleted shares from the database table oc_share
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/updater.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/updater.php b/apps/files_sharing/lib/updater.php index a43ab2e2a0a..e0f8fc5f0f6 100644 --- a/apps/files_sharing/lib/updater.php +++ b/apps/files_sharing/lib/updater.php @@ -57,6 +57,14 @@ class Shared_Updater { } } + private static function removeShare($path) { + $fileInfo = \OC\Files\Filesystem::getFileInfo($path); + $fileSource = $fileInfo['fileid']; + + $query = \OC_DB::prepare('DELETE FROM `*PREFIX*share` WHERE `file_source`=?'); + \OC_DB::executeAudited($query, array($fileSource)); + } + /** * @param array $params */ @@ -77,8 +85,10 @@ class Shared_Updater { */ static public function deleteHook($params) { self::correctFolders($params['path']); + self::removeShare($params['path']); } + /** * @param array $params */ |