From 3000f0125fe9470012c362a13ecc33a31cceff18 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Fri, 17 Jul 2015 12:49:45 +0200 Subject: don't move keys if the key where already moved in a previous migration run --- settings/application.php | 3 ++- settings/controller/encryptioncontroller.php | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'settings') diff --git a/settings/application.php b/settings/application.php index 03203b48564..a2f25935e12 100644 --- a/settings/application.php +++ b/settings/application.php @@ -79,7 +79,8 @@ class Application extends App { $c->query('Config'), $c->query('DatabaseConnection'), $c->query('UserManager'), - new View() + new View(), + $c->query('Logger') ); }); $container->registerService('AppSettingsController', function(IContainer $c) { diff --git a/settings/controller/encryptioncontroller.php b/settings/controller/encryptioncontroller.php index 87cbf0a4bf1..7c952962c1a 100644 --- a/settings/controller/encryptioncontroller.php +++ b/settings/controller/encryptioncontroller.php @@ -25,6 +25,7 @@ use OC\Files\View; use OCA\Encryption\Migration; use OCP\IL10N; use OCP\AppFramework\Controller; +use OCP\ILogger; use OCP\IRequest; use OCP\IConfig; use OC\DB\Connection; @@ -50,6 +51,9 @@ class EncryptionController extends Controller { /** @var View */ private $view; + /** @var ILogger */ + private $logger; + /** * @param string $appName * @param IRequest $request @@ -58,6 +62,7 @@ class EncryptionController extends Controller { * @param \OC\DB\Connection $connection * @param IUserManager $userManager * @param View $view + * @param ILogger $logger */ public function __construct($appName, IRequest $request, @@ -65,7 +70,8 @@ class EncryptionController extends Controller { IConfig $config, Connection $connection, IUserManager $userManager, - View $view) { + View $view, + ILogger $logger) { parent::__construct($appName, $request); $this->l10n = $l10n; $this->config = $config; @@ -85,7 +91,7 @@ class EncryptionController extends Controller { try { - $migration = new Migration($this->config, $this->view, $this->connection); + $migration = new Migration($this->config, $this->view, $this->connection, $this->logger); $migration->reorganizeSystemFolderStructure(); $migration->updateDB(); -- cgit v1.2.3