summaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib/Migration.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/encryption/lib/Migration.php')
-rw-r--r--apps/encryption/lib/Migration.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/encryption/lib/Migration.php b/apps/encryption/lib/Migration.php
index 7f4acbb68d4..656cab6a1e1 100644
--- a/apps/encryption/lib/Migration.php
+++ b/apps/encryption/lib/Migration.php
@@ -26,6 +26,7 @@ namespace OCA\Encryption;
use OC\Files\View;
+use OCP\App\IAppManager;
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\ILogger;
@@ -43,6 +44,8 @@ class Migration {
private $logger;
/** @var string*/
protected $installedVersion;
+ /** @var IAppManager */
+ protected $appManager;
/**
* @param IConfig $config
@@ -50,7 +53,7 @@ class Migration {
* @param IDBConnection $connection
* @param ILogger $logger
*/
- public function __construct(IConfig $config, View $view, IDBConnection $connection, ILogger $logger) {
+ public function __construct(IConfig $config, View $view, IDBConnection $connection, ILogger $logger, IAppManager $appManager) {
$this->view = $view;
$this->view->disableCacheUpdate();
$this->connection = $connection;
@@ -58,6 +61,7 @@ class Migration {
$this->config = $config;
$this->logger = $logger;
$this->installedVersion = $this->config->getAppValue('files_encryption', 'installed_version', '-1');
+ $this->appManager = $appManager;
}
public function finalCleanUp() {
@@ -137,7 +141,7 @@ class Migration {
$path = '/files_encryption/keys';
$this->renameFileKeys($user, $path);
$trashPath = '/files_trashbin/keys';
- if (\OC_App::isEnabled('files_trashbin') && $this->view->is_dir($user . '/' . $trashPath)) {
+ if ($this->appManager->isEnabledForUser('files_trashbin') && $this->view->is_dir($user . '/' . $trashPath)) {
$this->renameFileKeys($user, $trashPath, true);
$this->view->deleteAll($trashPath);
}