From 0fd0e02b2b66367257ffaadd41920d9eaee6cf37 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 13 Oct 2014 15:41:50 +0200 Subject: [PATCH] Delete external storage cache after deletion --- apps/files_external/lib/config.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 92bb891ca21b..0bf3a3d7136b 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -567,6 +567,21 @@ public static function removeMountPoint($mountPoint, $mountType, $applicable, $i } $mountPoint = \OC\Files\Filesystem::normalizePath($mountPoint); $mountPoints = self::readData($isPersonal ? OCP\User::getUser() : NULL); + + $options = $mountPoints[$mountType][$applicable][$mountPoint]; + if (isset($options['options'])) { + $options['options'] = self::decryptPasswords($options['options']); + } + if ($isPersonal) { + $mount = new \OCA\Files_External\PersonalMount($options['class'], $mountPoint, $options['options'], $loader); + } else{ + $mount = new \OC\Files\Mount\Mount($options['class'], $mountPoint, $options['options'], $loader); + } + $storageId = $mount->getStorageId(); + if (!empty($storageId)) { + // delete storage and cache entries + \OC\Files\Cache\Storage::remove($storageId); + } // Remove mount point unset($mountPoints[$mountType][$applicable][$mountPoint]); // Unset parent arrays if empty