Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
namespace OCA\Encryption;


use OC\Files\Cache\Cache;
use OC\Files\View;
use OCP\IConfig;
use OCP\IDBConnection;
Expand Down Expand Up @@ -67,6 +68,7 @@ public function finalCleanUp() {
}

/**
* FIXME don't run our own sql here, use the filecache
* update file cache, copy unencrypted_size to the 'size' column
*/
private function updateFileCache() {
Expand All @@ -79,6 +81,7 @@ private function updateFileCache() {
->where($query->expr()->eq('encrypted', $query->createParameter('encrypted')))
->setParameter('encrypted', 1);
$query->execute();
Cache::$metaDataCache->clear();
}
}

Expand All @@ -91,7 +94,7 @@ public function reorganizeFolderStructure() {
$limit = 500;
$offset = 0;
do {
$users = \OC::$server->getUserManager()->search('', $limit, $offset);
$users = \OC::$server->getUserManager()->search('', $limit, $offset);
foreach ($users as $user) {
$this->reorganizeFolderStructureForUser($user->getUID());
}
Expand Down Expand Up @@ -349,7 +352,7 @@ private function getTargetDir($user, $keyPath, $filename, $trash) {
foreach ($systemMountPoints as $mountPoint) {
$normalizedMountPoint = \OC\Files\Filesystem::normalizePath($mountPoint['mountpoint']) . '/';
if (strpos($normalized, $normalizedMountPoint) === 0) {
return $targetDir;
return $targetDir;
}
}
} else if ($trash === false && $this->view->file_exists('/' . $user . '/files/' . $filePath)) {
Expand Down