diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-03-26 21:14:59 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-03-26 21:14:59 +0100 |
commit | 232518ac548a1d8f99c51fe391eb6132c1154dba (patch) | |
tree | dcf369f169b600028bdb2d55d577fc7ffe781b32 /settings | |
parent | 0cb133003ced4e3d2486b6301459ea0e998ef2ec (diff) | |
parent | ff9c85ce60aac1098c741b7ea630d9fc545e3d96 (diff) | |
download | nextcloud-server-232518ac548a1d8f99c51fe391eb6132c1154dba.tar.gz nextcloud-server-232518ac548a1d8f99c51fe391eb6132c1154dba.zip |
Merge pull request #15234 from owncloud/encryption2_core
core part of encryption 2.0
Diffstat (limited to 'settings')
-rw-r--r-- | settings/admin.php | 18 | ||||
-rw-r--r-- | settings/css/settings.css | 9 | ||||
-rw-r--r-- | settings/js/admin.js | 16 | ||||
-rw-r--r-- | settings/templates/admin.php | 24 |
4 files changed, 67 insertions, 0 deletions
diff --git a/settings/admin.php b/settings/admin.php index 9f5f36b2210..4416af1fe37 100644 --- a/settings/admin.php +++ b/settings/admin.php @@ -81,6 +81,23 @@ $template->assign('shareExcludeGroups', $excludeGroups); $excludedGroupsList = $appConfig->getValue('core', 'shareapi_exclude_groups_list', ''); $excludedGroupsList = explode(',', $excludedGroupsList); // FIXME: this should be JSON! $template->assign('shareExcludedGroupsList', implode('|', $excludedGroupsList)); +$template->assign('encryptionEnabled', \OC::$server->getEncryptionManager()->isEnabled()); +$encryptionModules = \OC::$server->getEncryptionManager()->getEncryptionModules(); +try { + $defaultEncryptionModule = \OC::$server->getEncryptionManager()->getDefaultEncryptionModule(); + $defaultEncryptionModuleId = $defaultEncryptionModule->getId(); +} catch (Exception $e) { + $defaultEncryptionModule = null; +} +$encModulues = array(); +foreach ($encryptionModules as $module) { + $encModulues[$module->getId()]['displayName'] = $module->getDisplayName(); + $encModulues[$module->getId()]['default'] = false; + if ($defaultEncryptionModule && $module->getId() === $defaultEncryptionModuleId) { + $encModulues[$module->getId()]['default'] = true; + } +} +$template->assign('encryptionModules', $encModulues); // If the current web root is non-empty but the web root from the config is, // and system cron is used, the URL generator fails to build valid URLs. @@ -142,6 +159,7 @@ $formsAndMore = array_merge($formsAndMore, $formsMap); // add bottom hardcoded forms from the template $formsAndMore[] = array('anchor' => 'backgroundjobs', 'section-name' => $l->t('Cron')); $formsAndMore[] = array('anchor' => 'shareAPI', 'section-name' => $l->t('Sharing')); +$formsAndMore[] = array('anchor' => 'encryptionAPI', 'section-name' => $l->t('Server Side Encryption')); $formsAndMore[] = array('anchor' => 'mail_general_settings', 'section-name' => $l->t('Email Server')); $formsAndMore[] = array('anchor' => 'log-section', 'section-name' => $l->t('Log')); $formsAndMore[] = array('anchor' => 'admin-tips', 'section-name' => $l->t('Tips & tricks')); diff --git a/settings/css/settings.css b/settings/css/settings.css index 050914beef6..869a113762b 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -407,3 +407,12 @@ doesnotexist:-o-prefocus, .strengthify-wrapper { display: inline-block; padding: 3px 0; } + +#selectEncryptionModules { + margin-left: 30px; + padding: 10px; +} + +#encryptionModules { + padding: 10px; +}
\ No newline at end of file diff --git a/settings/js/admin.js b/settings/js/admin.js index 6ec1a061fc9..d1dc23382f9 100644 --- a/settings/js/admin.js +++ b/settings/js/admin.js @@ -54,6 +54,22 @@ $(document).ready(function(){ $('#shareAPI p:not(#enable)').toggleClass('hidden', !this.checked); }); + $('#encryptionEnabled').change(function() { + $('#encryptionAPI div#selectEncryptionModules').toggleClass('hidden'); + }); + + $('#encryptionAPI input').change(function() { + var value = $(this).val(); + if ($(this).attr('type') === 'checkbox') { + if (this.checked) { + value = 'yes'; + } else { + value = 'no'; + } + } + OC.AppConfig.setValue('core', $(this).attr('name'), value); + }); + $('#shareAPI input:not(#excludedGroups)').change(function() { var value = $(this).val(); if ($(this).attr('type') === 'checkbox') { diff --git a/settings/templates/admin.php b/settings/templates/admin.php index 42ae42a4d02..44680674e8e 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -291,6 +291,30 @@ if ($_['cronErrors']) { </p> </div> +<div class="section" id='encryptionAPI'> + <h2><?php p($l->t('Server Side Encryption'));?></h2> + <p id="enable"> + <input type="checkbox" name="encryption_enabled" id="encryptionEnabled" + value="1" <?php if ($_['encryptionEnabled']) print_unescaped('checked="checked"'); ?> /> + <label for="encryptionEnabled"><?php p($l->t('Enable Server-Side-Encryption'));?></label><br/> + </p> + <div id='selectEncryptionModules' class="<?php if (!$_['encryptionEnabled']) { p('hidden'); }?>"> + <?php if (empty($_['encryptionModules'])): p('No encryption module loaded, please load a encryption module in the app menu'); + else: ?> + <h3>Select default encryption module:</h3> + <fieldset id='encryptionModules'> + <?php foreach ($_['encryptionModules'] as $id => $module): ?> + <input type="radio" id="<?php p($id) ?>" + name="default_encryption_module" + value="<?php p($id) ?>" + <?php if($module['default']) { p('checked'); } ?>> + <label for="<?php p($id) ?>"><?php p($module['displayName']) ?></label><br /> + <?php endforeach;?> + </fieldset> + <?php endif; ?> + </div> +</div> + <div class="section"> <form id="mail_general_settings" class="mail_settings"> <h2><?php p($l->t('Email Server'));?></h2> |