diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2015-04-07 18:05:54 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2015-04-16 14:15:04 +0200 |
commit | e3d77c4b0181e2219f30f720ac7077b334210f5d (patch) | |
tree | 8d2042de13e0ff8036b92c2040e64c5774e2e6be /apps/encryption/appinfo | |
parent | 1a894bd0d8ab034f35dbb3b723dd195e7f66aab4 (diff) | |
download | nextcloud-server-e3d77c4b0181e2219f30f720ac7077b334210f5d.tar.gz nextcloud-server-e3d77c4b0181e2219f30f720ac7077b334210f5d.zip |
add migration script from old encryption to new one
Diffstat (limited to 'apps/encryption/appinfo')
-rw-r--r-- | apps/encryption/appinfo/app.php | 8 | ||||
-rw-r--r-- | apps/encryption/appinfo/application.php | 13 | ||||
-rw-r--r-- | apps/encryption/appinfo/info.xml | 2 | ||||
-rw-r--r-- | apps/encryption/appinfo/register_command.php | 15 |
4 files changed, 28 insertions, 10 deletions
diff --git a/apps/encryption/appinfo/app.php b/apps/encryption/appinfo/app.php index 6bbf2113366..0e8ce56227b 100644 --- a/apps/encryption/appinfo/app.php +++ b/apps/encryption/appinfo/app.php @@ -24,6 +24,8 @@ namespace OCA\Encryption\AppInfo; $app = new Application(); -$app->registerEncryptionModule(); -$app->registerHooks(); -$app->registerSettings(); +if (\OC::$server->getEncryptionManager()->isReady()) { + $app->registerEncryptionModule(); + $app->registerHooks(); + $app->registerSettings(); +} diff --git a/apps/encryption/appinfo/application.php b/apps/encryption/appinfo/application.php index 34845ecf1e8..6b67b6d95bc 100644 --- a/apps/encryption/appinfo/application.php +++ b/apps/encryption/appinfo/application.php @@ -40,13 +40,10 @@ use OCP\IConfig; class Application extends \OCP\AppFramework\App { - /** - * @var IManager - */ + + /** @var IManager */ private $encryptionManager; - /** - * @var IConfig - */ + /** @var IConfig */ private $config; /** @@ -59,6 +56,10 @@ class Application extends \OCP\AppFramework\App { $this->registerServices(); } + /** + * register hooks + */ + public function registerHooks() { if (!$this->config->getSystemValue('maintenance', false)) { diff --git a/apps/encryption/appinfo/info.xml b/apps/encryption/appinfo/info.xml index e4a7d790e9c..53a2459f864 100644 --- a/apps/encryption/appinfo/info.xml +++ b/apps/encryption/appinfo/info.xml @@ -16,7 +16,7 @@ based on AES 128 or 256 bit keys. More information is available in the Encryption documentation </description> -<name>Encryption</name> + <name>ownCloud Default Encryption Module</name> <license>AGPL</license> <author>Bjoern Schiessle, Clark Tomlinson</author> <requiremin>8</requiremin> diff --git a/apps/encryption/appinfo/register_command.php b/apps/encryption/appinfo/register_command.php new file mode 100644 index 00000000000..8a9df8ea3eb --- /dev/null +++ b/apps/encryption/appinfo/register_command.php @@ -0,0 +1,15 @@ +<?php +/** + * Copyright (c) 2015 Thomas Müller <deepdiver@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +use OCA\Encryption\Command\MigrateKeys; + +$userManager = OC::$server->getUserManager(); +$view = new \OC\Files\View(); +$config = \OC::$server->getConfig(); +$connection = \OC::$server->getDatabaseConnection(); +$application->add(new MigrateKeys($userManager, $view, $connection, $config)); |