summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-03-31 11:50:53 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-07 13:30:29 +0200
commitbf809ac85aa6739010463235fe8f7878993c39ee (patch)
tree5fb347cb7e502f5622d7327c46cd69f1ec68efbc /settings
parent6ccd3ffa23882b7d5018d707d2563a12c418fc09 (diff)
downloadnextcloud-server-bf809ac85aa6739010463235fe8f7878993c39ee.tar.gz
nextcloud-server-bf809ac85aa6739010463235fe8f7878993c39ee.zip
Removing left overs from old encryption app
Diffstat (limited to 'settings')
-rw-r--r--settings/ajax/decryptall.php62
-rw-r--r--settings/ajax/deletekeys.php35
-rw-r--r--settings/ajax/restorekeys.php35
-rw-r--r--settings/js/personal.js75
-rw-r--r--settings/personal.php11
-rw-r--r--settings/routes.php6
-rw-r--r--settings/templates/personal.php52
7 files changed, 0 insertions, 276 deletions
diff --git a/settings/ajax/decryptall.php b/settings/ajax/decryptall.php
deleted file mode 100644
index 5925cee9dfd..00000000000
--- a/settings/ajax/decryptall.php
+++ /dev/null
@@ -1,62 +0,0 @@
-<?php
-/**
- * @author Björn Schießle <schiessle@owncloud.com>
- * @author Joas Schilling <nickvergessen@owncloud.com>
- * @author Lukas Reschke <lukas@owncloud.com>
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Robin Appelman <icewind@owncloud.com>
- * @author Thomas Müller <thomas.mueller@tmit.eu>
- * @author Volkan Gezer <volkangezer@gmail.com>
- *
- * @copyright Copyright (c) 2015, ownCloud, Inc.
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-OCP\JSON::checkLoggedIn();
-OCP\JSON::callCheck();
-
-//encryption app needs to be loaded
-OC_App::loadApp('files_encryption');
-
-// init encryption app
-$params = array('uid' => \OCP\User::getUser(),
- 'password' => (string)$_POST['password']);
-
-$view = new OC\Files\View('/');
-$util = new \OCA\Files_Encryption\Util($view, \OCP\User::getUser());
-$l = \OC::$server->getL10N('settings');
-
-$result = $util->initEncryption($params);
-
-if ($result !== false) {
-
- try {
- $successful = $util->decryptAll();
- } catch (\Exception $ex) {
- \OCP\Util::writeLog('encryption library', "Decryption finished unexpected: " . $ex->getMessage(), \OCP\Util::ERROR);
- $successful = false;
- }
-
- $util->closeEncryptionSession();
-
- if ($successful === true) {
- \OCP\JSON::success(array('data' => array('message' => $l->t('Files decrypted successfully'))));
- } else {
- \OCP\JSON::error(array('data' => array('message' => $l->t('Couldn\'t decrypt your files, please check your owncloud.log or ask your administrator'))));
- }
-} else {
- \OCP\JSON::error(array('data' => array('message' => $l->t('Couldn\'t decrypt your files, check your password and try again'))));
-}
-
diff --git a/settings/ajax/deletekeys.php b/settings/ajax/deletekeys.php
deleted file mode 100644
index 2192eb8c725..00000000000
--- a/settings/ajax/deletekeys.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * @author Björn Schießle <schiessle@owncloud.com>
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Robin Appelman <icewind@owncloud.com>
- *
- * @copyright Copyright (c) 2015, ownCloud, Inc.
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-OCP\JSON::checkLoggedIn();
-OCP\JSON::callCheck();
-
-$l = \OC::$server->getL10N('settings');
-
-$util = new \OCA\Files_Encryption\Util(new \OC\Files\View(), \OC_User::getUser());
-$result = $util->deleteBackup('decryptAll');
-
-if ($result) {
- \OCP\JSON::success(array('data' => array('message' => $l->t('Encryption keys deleted permanently'))));
-} else {
- \OCP\JSON::error(array('data' => array('message' => $l->t('Couldn\'t permanently delete your encryption keys, please check your owncloud.log or ask your administrator'))));
-}
diff --git a/settings/ajax/restorekeys.php b/settings/ajax/restorekeys.php
deleted file mode 100644
index 52c02b3aba4..00000000000
--- a/settings/ajax/restorekeys.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * @author Björn Schießle <schiessle@owncloud.com>
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Robin Appelman <icewind@owncloud.com>
- *
- * @copyright Copyright (c) 2015, ownCloud, Inc.
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-OCP\JSON::checkLoggedIn();
-OCP\JSON::callCheck();
-
-$l = \OC::$server->getL10N('settings');
-
-$util = new \OCA\Files_Encryption\Util(new \OC\Files\View(), \OC_User::getUser());
-$result = $util->restoreBackup('decryptAll');
-
-if ($result) {
- \OCP\JSON::success(array('data' => array('message' => $l->t('Backups restored successfully'))));
-} else {
- \OCP\JSON::error(array('data' => array('message' => $l->t('Couldn\'t restore your encryption keys, please check your owncloud.log or ask your administrator'))));
-}
diff --git a/settings/js/personal.js b/settings/js/personal.js
index 30d7f5e9388..a847a1ee3a3 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -230,40 +230,6 @@ $(document).ready(function () {
return false;
});
- $('button:button[name="submitDecryptAll"]').click(function () {
- var privateKeyPassword = $('#decryptAll input:password[id="privateKeyPassword"]').val();
- $('#decryptAll button:button[name="submitDecryptAll"]').prop("disabled", true);
- $('#decryptAll input:password[name="privateKeyPassword"]').prop("disabled", true);
- OC.Encryption.decryptAll(privateKeyPassword);
- });
-
-
- $('button:button[name="submitRestoreKeys"]').click(function () {
- $('#restoreBackupKeys button:button[name="submitDeleteKeys"]').prop("disabled", true);
- $('#restoreBackupKeys button:button[name="submitRestoreKeys"]').prop("disabled", true);
- OC.Encryption.restoreKeys();
- });
-
- $('button:button[name="submitDeleteKeys"]').click(function () {
- $('#restoreBackupKeys button:button[name="submitDeleteKeys"]').prop("disabled", true);
- $('#restoreBackupKeys button:button[name="submitRestoreKeys"]').prop("disabled", true);
- OC.Encryption.deleteKeys();
- });
-
- $('#decryptAll input:password[name="privateKeyPassword"]').keyup(function (event) {
- var privateKeyPassword = $('#decryptAll input:password[id="privateKeyPassword"]').val();
- if (privateKeyPassword !== '') {
- $('#decryptAll button:button[name="submitDecryptAll"]').prop("disabled", false);
- if (event.which === 13) {
- $('#decryptAll button:button[name="submitDecryptAll"]').prop("disabled", true);
- $('#decryptAll input:password[name="privateKeyPassword"]').prop("disabled", true);
- OC.Encryption.decryptAll(privateKeyPassword);
- }
- } else {
- $('#decryptAll button:button[name="submitDecryptAll"]').prop("disabled", true);
- }
- });
-
var uploadparms = {
done: function (e, data) {
avatarResponseHandler(data.result);
@@ -380,47 +346,6 @@ $(document).ready(function () {
});
OC.Encryption = {
- decryptAll: function (password) {
- var message = t('settings', 'Decrypting files... Please wait, this can take some time.');
- OC.Encryption.msg.start('#decryptAll .msg', message);
- $.post('ajax/decryptall.php', {password: password}, function (data) {
- if (data.status === "error") {
- OC.Encryption.msg.finished('#decryptAll .msg', data);
- $('#decryptAll input:password[name="privateKeyPassword"]').prop("disabled", false);
- } else {
- OC.Encryption.msg.finished('#decryptAll .msg', data);
- }
- $('#restoreBackupKeys').removeClass('hidden');
- });
- },
-
- deleteKeys: function () {
- var message = t('settings', 'Delete encryption keys permanently.');
- OC.Encryption.msg.start('#restoreBackupKeys .msg', message);
- $.post('ajax/deletekeys.php', null, function (data) {
- if (data.status === "error") {
- OC.Encryption.msg.finished('#restoreBackupKeys .msg', data);
- $('#restoreBackupKeys button:button[name="submitDeleteKeys"]').prop("disabled", false);
- $('#restoreBackupKeys button:button[name="submitRestoreKeys"]').prop("disabled", false);
- } else {
- OC.Encryption.msg.finished('#restoreBackupKeys .msg', data);
- }
- });
- },
-
- restoreKeys: function () {
- var message = t('settings', 'Restore encryption keys.');
- OC.Encryption.msg.start('#restoreBackupKeys .msg', message);
- $.post('ajax/restorekeys.php', {}, function (data) {
- if (data.status === "error") {
- OC.Encryption.msg.finished('#restoreBackupKeys .msg', data);
- $('#restoreBackupKeys button:button[name="submitDeleteKeys"]').prop("disabled", false);
- $('#restoreBackupKeys button:button[name="submitRestoreKeys"]').prop("disabled", false);
- } else {
- OC.Encryption.msg.finished('#restoreBackupKeys .msg', data);
- }
- });
- }
};
OC.Encryption.msg = {
diff --git a/settings/personal.php b/settings/personal.php
index e4d278d4f28..12b320ac001 100644
--- a/settings/personal.php
+++ b/settings/personal.php
@@ -59,11 +59,6 @@ $email=$config->getUserValue(OC_User::getUser(), 'settings', 'email', '');
$userLang=$config->getUserValue( OC_User::getUser(), 'core', 'lang', OC_L10N::findLanguage() );
$languageCodes=OC_L10N::findAvailableLanguages();
-//check if encryption was enabled in the past
-$filesStillEncrypted = OC_Util::encryptedFiles();
-$backupKeysExists = OC_Util::backupKeysExists();
-$enableDecryptAll = $filesStillEncrypted || $backupKeysExists;
-
// array of common languages
$commonlangcodes = array(
'en', 'es', 'fr', 'de', 'de_DE', 'ja', 'ar', 'ru', 'nl', 'it', 'pt_BR', 'pt_PT', 'da', 'fi_FI', 'nb_NO', 'sv', 'tr', 'zh_CN', 'ko'
@@ -120,9 +115,6 @@ $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' , $enableDecryptAll);
-$tmpl->assign('backupKeysExists' , $backupKeysExists);
-$tmpl->assign('filesStillEncrypted' , $filesStillEncrypted);
$tmpl->assign('enableAvatars', $config->getSystemValue('enable_avatars', true));
$tmpl->assign('avatarChangeSupported', OC_User::canUserChangeAvatar(OC_User::getUser()));
$tmpl->assign('certs', $certificateManager->listCertificates());
@@ -163,9 +155,6 @@ $formsAndMore = array_merge($formsAndMore, $formsMap);
// add bottom hardcoded forms from the template
$formsAndMore[]= array( 'anchor' => 'ssl-root-certificates', 'section-name' => $l->t('SSL root certificates') );
-if($enableDecryptAll) {
- $formsAndMore[]= array( 'anchor' => 'encryption', 'section-name' => $l->t('Encryption') );
-}
$tmpl->assign('forms', $formsAndMore);
$tmpl->printPage();
diff --git a/settings/routes.php b/settings/routes.php
index 5a069e5a1c6..af9ac1d8eea 100644
--- a/settings/routes.php
+++ b/settings/routes.php
@@ -89,12 +89,6 @@ $this->create('settings_personal_changepassword', '/settings/personal/changepass
->action('OC\Settings\ChangePassword\Controller', 'changePersonalPassword');
$this->create('settings_ajax_setlanguage', '/settings/ajax/setlanguage.php')
->actionInclude('settings/ajax/setlanguage.php');
-$this->create('settings_ajax_decryptall', '/settings/ajax/decryptall.php')
- ->actionInclude('settings/ajax/decryptall.php');
-$this->create('settings_ajax_restorekeys', '/settings/ajax/restorekeys.php')
- ->actionInclude('settings/ajax/restorekeys.php');
-$this->create('settings_ajax_deletekeys', '/settings/ajax/deletekeys.php')
- ->actionInclude('settings/ajax/deletekeys.php');
$this->create('settings_cert_post', '/settings/ajax/addRootCertificate')
->actionInclude('settings/ajax/addRootCertificate.php');
$this->create('settings_cert_remove', '/settings/ajax/removeRootCertificate')
diff --git a/settings/templates/personal.php b/settings/templates/personal.php
index 2a0b4bb0dc4..dfdc6191805 100644
--- a/settings/templates/personal.php
+++ b/settings/templates/personal.php
@@ -242,58 +242,6 @@ if($_['passwordChangeSupported']) {
</form>
</div>
-<?php if($_['enableDecryptAll']): ?>
-<div id="encryption" class="section">
-
- <h2>
- <?php p( $l->t( 'Encryption' ) ); ?>
- </h2>
-
- <?php if($_['filesStillEncrypted']): ?>
-
- <div id="decryptAll">
- <?php p($l->t( "The encryption app is no longer enabled, please decrypt all your files" )); ?>
- <p>
- <input
- type="password"
- name="privateKeyPassword"
- id="privateKeyPassword" />
- <label for="privateKeyPassword"><?php p($l->t( "Log-in password" )); ?></label>
- <br />
- <button
- type="button"
- disabled
- name="submitDecryptAll"><?php p($l->t( "Decrypt all Files" )); ?>
- </button>
- <span class="msg"></span>
- </p>
- <br />
- </div>
- <?php endif; ?>
-
- <div id="restoreBackupKeys" <?php $_['backupKeysExists'] ? '' : print_unescaped("class='hidden'") ?>>
-
- <?php p($l->t( "Your encryption keys are moved to a backup location. If something went wrong you can restore the keys. Only delete them permanently if you are sure that all files are decrypted correctly." )); ?>
- <p>
- <button
- type="button"
- name="submitRestoreKeys"><?php p($l->t( "Restore Encryption Keys" )); ?>
- </button>
- <button
- type="button"
- name="submitDeleteKeys"><?php p($l->t( "Delete Encryption Keys" )); ?>
- </button>
- <span class="msg"></span>
-
- </p>
- <br />
-
- </div>
-
-
-</div>
- <?php endif; ?>
-
<div class="section">
<h2><?php p($l->t('Version'));?></h2>
<strong><?php p($theme->getTitle()); ?></strong> <?php p(OC_Util::getHumanVersion()) ?><br />