]> source.dussan.org Git - nextcloud-server.git/commitdiff
remove deleted shares from the database table oc_share
authorBjoern Schiessle <schiessle@owncloud.com>
Wed, 2 Oct 2013 11:26:38 +0000 (13:26 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Mon, 7 Oct 2013 09:08:39 +0000 (11:08 +0200)
apps/files_sharing/lib/updater.php

index a43ab2e2a0a5e07ad5188b96b3e481e99c60d69e..e0f8fc5f0f633b0a4df0d49f95e602dbbb2ef04d 100644 (file)
@@ -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
         */