Merge pull request #15718 from owncloud/issue/15694-display-name-of-encryption-modules

Issue/15694 display name of encryption modules
This commit is contained in:
Thomas Müller 2015-04-18 22:51:15 +02:00
commit cdf82909b8
3 changed files with 7 additions and 7 deletions

View file

@ -2,5 +2,5 @@
$manager = \OC::$server->getEncryptionManager();
$module = new \OCA\Encryption_Dummy\DummyModule();
$manager->registerEncryptionModule($module);
$manager->registerEncryptionModule('OC_DUMMY_MODULE', 'Dummy Encryption Module', $module);

View file

@ -106,11 +106,11 @@ class Manager implements IManager {
$this->setDefaultEncryptionModule($id);
}
$this->encryptionModules[$id] = array(
$this->encryptionModules[$id] = [
'id' => $id,
'displayName' => 'displayName',
'callback' => $callback
);
'displayName' => $displayName,
'callback' => $callback,
];
}
/**

View file

@ -92,13 +92,13 @@ try {
$defaultEncryptionModule = \OC::$server->getEncryptionManager()->getDefaultEncryptionModule();
$defaultEncryptionModuleId = $defaultEncryptionModule->getId();
} catch (Exception $e) {
$defaultEncryptionModule = null;
$defaultEncryptionModuleId = null;
}
$encModulues = array();
foreach ($encryptionModules as $module) {
$encModulues[$module['id']]['displayName'] = $module['displayName'];
$encModulues[$module['id']]['default'] = false;
if ($defaultEncryptionModule && $module['id'] === $defaultEncryptionModuleId) {
if ($module['id'] === $defaultEncryptionModuleId) {
$encModulues[$module['id']]['default'] = true;
}
}