summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-06-10 11:03:07 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-07-29 13:36:06 +0200
commit2c8e5ec84ff98088fb9e3b275735098beaa5e27f (patch)
treee0cf14263f97b2b3296ca52a6422dbe74b0ad598 /settings
parent48621115c10f62f776dbe41ad9a51c1ac360fc8c (diff)
downloadnextcloud-server-2c8e5ec84ff98088fb9e3b275735098beaa5e27f.tar.gz
nextcloud-server-2c8e5ec84ff98088fb9e3b275735098beaa5e27f.zip
user interface to allow user to decrypt all his files once the encryption app was disabled
Conflicts: settings/templates/personal.php
Diffstat (limited to 'settings')
-rw-r--r--settings/personal.php10
-rw-r--r--settings/templates/personal.php18
2 files changed, 28 insertions, 0 deletions
diff --git a/settings/personal.php b/settings/personal.php
index 1e2e1cf6723..4961661e250 100644
--- a/settings/personal.php
+++ b/settings/personal.php
@@ -24,6 +24,15 @@ $email=OC_Preferences::getValue(OC_User::getUser(), 'settings', 'email', '');
$userLang=OC_Preferences::getValue( OC_User::getUser(), 'core', 'lang', OC_L10N::findLanguage() );
$languageCodes=OC_L10N::findAvailableLanguages();
+//check if encryption was enabled in the past
+$enableDecryptAll = false;
+if (OC_App::isEnabled('files_encryption') === false) {
+ $view = new OC\Files\View('/'.OC_User::getUser());
+ if ($view->file_exists('files_encryption/keyfiles')) {
+ $enableDecryptAll = true;
+ }
+}
+
// array of common languages
$commonlangcodes = array(
'en', 'es', 'fr', 'de', 'de_DE', 'ja_JP', 'ar', 'ru', 'nl', 'it', 'pt_BR', 'pt_PT', 'da', 'fi_FI', 'nb_NO', 'sv', 'zh_CN', 'ko'
@@ -80,6 +89,7 @@ $tmpl->assign('activelanguage', $userLang);
$tmpl->assign('passwordChangeSupported', OC_User::canUserChangePassword(OC_User::getUser()));
$tmpl->assign('displayNameChangeSupported', OC_User::canUserChangeDisplayName(OC_User::getUser()));
$tmpl->assign('displayName', OC_User::getDisplayName());
+$tmpl->assign('enableDecryptAll' , true);
$forms=OC_App::getForms('personal');
$tmpl->assign('forms', array());
diff --git a/settings/templates/personal.php b/settings/templates/personal.php
index b9d9b09f5d0..c0f3600a51e 100644
--- a/settings/templates/personal.php
+++ b/settings/templates/personal.php
@@ -110,6 +110,24 @@ if($_['passwordChangeSupported']) {
print_unescaped($form);
};?>
+<?php if($_['enableDecryptAll']): ?>
+<form id="encryption">
+ <fieldset class="personalblock">
+ <legend>
+ <?php p( $l->t( 'Encryption' ) ); ?>
+ </legend>
+ <?php p($l->t( "The encryption app is no longer enabled, decrypt all your file" )); ?>
+ <p>
+ <button
+ type="button"
+ name="submitDecryptAll"><?php p($l->t( "Decrypt all Files" )); ?>
+ </button>
+ </p>
+ <br />
+ </fieldset>
+</form>
+<?php endif; ?>
+
<fieldset class="personalblock">
<legend><strong><?php p($l->t('Version'));?></strong></legend>
<strong><?php p($theme->getName()); ?></strong> <?php p(OC_Util::getVersionString()); ?><br/>