Merge pull request #16034 from owncloud/issue-15987-encryption-module-admin-page
Display the module settings in the list of the encryption modules
This commit is contained in:
commit
12b24ee567
6 changed files with 21 additions and 9 deletions
|
@ -12,7 +12,7 @@ OC.Encryption = {
|
|||
updatePrivateKeyPassword: function () {
|
||||
var oldPrivateKeyPassword = $('input:password[id="oldPrivateKeyPassword"]').val();
|
||||
var newPrivateKeyPassword = $('input:password[id="newPrivateKeyPassword"]').val();
|
||||
OC.msg.startSaving('#encryption .msg');
|
||||
OC.msg.startSaving('#ocDefaultEncryptionModule .msg');
|
||||
$.post(
|
||||
OC.generateUrl('/apps/encryption/ajax/updatePrivateKeyPassword'),
|
||||
{
|
||||
|
@ -20,10 +20,10 @@ OC.Encryption = {
|
|||
newPassword: newPrivateKeyPassword
|
||||
}
|
||||
).done(function (data) {
|
||||
OC.msg.finishedSuccess('#encryption .msg', data.message);
|
||||
OC.msg.finishedSuccess('#ocDefaultEncryptionModule .msg', data.message);
|
||||
})
|
||||
.fail(function (jqXHR) {
|
||||
OC.msg.finishedError('#encryption .msg', JSON.parse(jqXHR.responseText).message);
|
||||
OC.msg.finishedError('#ocDefaultEncryptionModule .msg', JSON.parse(jqXHR.responseText).message);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
script('encryption', 'settings-admin');
|
||||
script('core', 'multiselect');
|
||||
?>
|
||||
<form id="encryption" class="section">
|
||||
<h2><?php p($l->t('ownCloud basic encryption module')); ?></h2>
|
||||
|
||||
<form id="ocDefaultEncryptionModule" class="sub-section">
|
||||
<?php if(!$_["initStatus"]): ?>
|
||||
<?php p($l->t("Encryption App is enabled but your keys are not initialized, please log-out and log-in again")); ?>
|
||||
<?php else: ?>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
script('encryption', 'settings-personal');
|
||||
script('core', 'multiselect');
|
||||
?>
|
||||
<form id="encryption" class="section">
|
||||
<form id="ocDefaultEncryptionModule" class="section">
|
||||
<h2><?php p($l->t('ownCloud basic encryption module')); ?></h2>
|
||||
|
||||
<?php if ($_["initialized"] === \OCA\Encryption\Session::NOT_INITIALIZED ): ?>
|
||||
|
|
|
@ -495,6 +495,12 @@ button.loading {
|
|||
.section.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
.sub-section {
|
||||
position: relative;
|
||||
margin-top: 10px;
|
||||
margin-left: 27px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
/* no top border for first settings item */
|
||||
#app-content > .section:first-child {
|
||||
border-top: none;
|
||||
|
|
|
@ -141,9 +141,10 @@ if ($request->getServerProtocol() !== 'https' || !OC_Util::isAnnotationsWorking
|
|||
$formsAndMore[] = array('anchor' => 'security-warning', 'section-name' => $l->t('Security & setup warnings'));
|
||||
}
|
||||
$formsAndMore[] = array('anchor' => 'shareAPI', 'section-name' => $l->t('Sharing'));
|
||||
$formsAndMore[] = ['anchor' => 'encryptionAPI', 'section-name' => $l->t('Server-side encryption')];
|
||||
|
||||
// Prioritize fileSharingSettings and files_external and move updater to the version
|
||||
$fileSharingSettings = $filesExternal = $updaterAppPanel = '';
|
||||
$fileSharingSettings = $filesExternal = $updaterAppPanel = $ocDefaultEncryptionModulePanel = '';
|
||||
foreach ($forms as $index => $form) {
|
||||
if (strpos($form, 'id="fileSharingSettings"')) {
|
||||
$fileSharingSettings = $form;
|
||||
|
@ -160,6 +161,11 @@ foreach ($forms as $index => $form) {
|
|||
unset($forms[$index]);
|
||||
continue;
|
||||
}
|
||||
if (strpos($form, 'id="ocDefaultEncryptionModule"')) {
|
||||
$ocDefaultEncryptionModulePanel = $form;
|
||||
unset($forms[$index]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ($filesExternal) {
|
||||
$formsAndMore[] = array('anchor' => 'files_external', 'section-name' => $l->t('External Storage'));
|
||||
|
@ -168,6 +174,7 @@ if ($filesExternal) {
|
|||
$template->assign('fileSharingSettings', $fileSharingSettings);
|
||||
$template->assign('filesExternal', $filesExternal);
|
||||
$template->assign('updaterAppPanel', $updaterAppPanel);
|
||||
$template->assign('ocDefaultEncryptionModulePanel', $ocDefaultEncryptionModulePanel);
|
||||
|
||||
$formsMap = array_map(function ($form) {
|
||||
if (preg_match('%(<h2[^>]*>.*?</h2>)%i', $form, $regs)) {
|
||||
|
@ -190,7 +197,6 @@ $formsMap = array_map(function ($form) {
|
|||
$formsAndMore = array_merge($formsAndMore, $formsMap);
|
||||
|
||||
// add bottom hardcoded forms from the template
|
||||
$formsAndMore[] = ['anchor' => 'encryptionAPI', 'section-name' => $l->t('Server-side encryption')];
|
||||
$formsAndMore[] = ['anchor' => 'backgroundjobs', 'section-name' => $l->t('Cron')];
|
||||
$formsAndMore[] = ['anchor' => 'mail_general_settings', 'section-name' => $l->t('Email server')];
|
||||
$formsAndMore[] = ['anchor' => 'log-section', 'section-name' => $l->t('Log')];
|
||||
|
|
|
@ -351,6 +351,8 @@ if ($_['cronErrors']) {
|
|||
<label
|
||||
for="<?php p($id) ?>"><?php p($module['displayName']) ?></label>
|
||||
<br/>
|
||||
|
||||
<?php if ($id === 'OC_DEFAULT_MODULE') print_unescaped($_['ocDefaultEncryptionModulePanel']); ?>
|
||||
<?php endforeach; ?>
|
||||
</fieldset>
|
||||
<?php } ?>
|
||||
|
|
Loading…
Reference in a new issue