[Pkg-owncloud-commits] [owncloud] 43/122: Display the module settings in the list of the encryption modules

David Prévot taffit at moszumanska.debian.org
Sat May 9 00:00:10 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit eadc2c330c36362cb192d7a352d31b5515aa26d5
Author: Joas Schilling <nickvergessen at owncloud.com>
Date:   Mon May 4 11:51:02 2015 +0200

    Display the module settings in the list of the encryption modules
---
 apps/encryption/js/settings-personal.js         |  6 +++---
 apps/encryption/templates/settings-admin.php    |  4 +---
 apps/encryption/templates/settings-personal.php |  2 +-
 core/css/apps.css                               |  6 ++++++
 settings/admin.php                              | 10 ++++++++--
 settings/templates/admin.php                    |  2 ++
 6 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/apps/encryption/js/settings-personal.js b/apps/encryption/js/settings-personal.js
index 658ba2a..fa94bea 100644
--- a/apps/encryption/js/settings-personal.js
+++ b/apps/encryption/js/settings-personal.js
@@ -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);
 			});
 	}
 };
diff --git a/apps/encryption/templates/settings-admin.php b/apps/encryption/templates/settings-admin.php
index b64e755..ac329b2 100644
--- a/apps/encryption/templates/settings-admin.php
+++ b/apps/encryption/templates/settings-admin.php
@@ -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: ?>
diff --git a/apps/encryption/templates/settings-personal.php b/apps/encryption/templates/settings-personal.php
index 6b8821c..e0a7fc2 100644
--- a/apps/encryption/templates/settings-personal.php
+++ b/apps/encryption/templates/settings-personal.php
@@ -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 ): ?>
diff --git a/core/css/apps.css b/core/css/apps.css
index 9b662cc..5713372 100644
--- a/core/css/apps.css
+++ b/core/css/apps.css
@@ -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;
diff --git a/settings/admin.php b/settings/admin.php
index e8d9c65..5720bd9 100644
--- a/settings/admin.php
+++ b/settings/admin.php
@@ -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')];
diff --git a/settings/templates/admin.php b/settings/templates/admin.php
index 5edf4e2..6d2796d 100644
--- a/settings/templates/admin.php
+++ b/settings/templates/admin.php
@@ -344,6 +344,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 } ?>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list