summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-04-14 16:48:39 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2015-04-17 10:31:33 +0200
commit7d4b1b52d08fd4bc8e9f65ca2ccc747de2fc429a (patch)
treec40489a85da1be3eb66041a2ca2719f38c0298f3 /apps
parentf32d97750c33942db53a56d1deceacb2ed3e779b (diff)
downloadnextcloud-server-7d4b1b52d08fd4bc8e9f65ca2ccc747de2fc429a.tar.gz
nextcloud-server-7d4b1b52d08fd4bc8e9f65ca2ccc747de2fc429a.zip
always create a new instance of the encryption module
Diffstat (limited to 'apps')
-rw-r--r--apps/encryption/appinfo/application.php18
-rw-r--r--apps/encryption/lib/crypto/encryption.php3
2 files changed, 13 insertions, 8 deletions
diff --git a/apps/encryption/appinfo/application.php b/apps/encryption/appinfo/application.php
index dbeb1171bd8..5d0fe2c9184 100644
--- a/apps/encryption/appinfo/application.php
+++ b/apps/encryption/appinfo/application.php
@@ -27,6 +27,7 @@ namespace OCA\Encryption\AppInfo;
use OC\Files\Filesystem;
use OC\Files\View;
use OCA\Encryption\Crypto\Crypt;
+use OCA\Encryption\Crypto\Encryption;
use OCA\Encryption\HookManager;
use OCA\Encryption\Hooks\UserHooks;
use OCA\Encryption\KeyManager;
@@ -90,14 +91,17 @@ class Application extends \OCP\AppFramework\App {
public function registerEncryptionModule() {
$container = $this->getContainer();
- $container->registerService('EncryptionModule', function (IAppContainer $c) {
- return new \OCA\Encryption\Crypto\Encryption(
- $c->query('Crypt'),
- $c->query('KeyManager'),
- $c->query('Util'));
+
+ $this->encryptionManager->registerEncryptionModule(
+ Encryption::ID,
+ Encryption::DISPLAY_NAME,
+ function() use ($container) {
+ return new Encryption(
+ $container->query('Crypt'),
+ $container->query('KeyManager'),
+ $container->query('Util')
+ );
});
- $module = $container->query('EncryptionModule');
- $this->encryptionManager->registerEncryptionModule($module);
}
public function registerServices() {
diff --git a/apps/encryption/lib/crypto/encryption.php b/apps/encryption/lib/crypto/encryption.php
index fd5a84c9734..8498b4223e1 100644
--- a/apps/encryption/lib/crypto/encryption.php
+++ b/apps/encryption/lib/crypto/encryption.php
@@ -32,6 +32,7 @@ use OCA\Encryption\KeyManager;
class Encryption implements IEncryptionModule {
const ID = 'OC_DEFAULT_MODULE';
+ const DISPLAY_NAME = 'ownCloud Default Encryption';
/**
* @var Crypt
@@ -90,7 +91,7 @@ class Encryption implements IEncryptionModule {
* @return string
*/
public function getDisplayName() {
- return 'ownCloud Default Encryption';
+ return self::DISPLAY_NAME;
}
/**