Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/files/index.php1
-rw-r--r--apps/files/js/files.js6
-rw-r--r--apps/files/templates/index.php1
-rw-r--r--lib/private/connector/sabre/file.php22
-rw-r--r--lib/private/util.php45
-rw-r--r--lib/public/util.php4
-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
13 files changed, 9 insertions, 346 deletions
diff --git a/apps/files/index.php b/apps/files/index.php
index 3f932859029..23830da695d 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -142,7 +142,6 @@ OCP\Util::addscript('files', 'keyboardshortcuts');
$tmpl = new OCP\Template('files', 'index', 'user');
$tmpl->assign('usedSpacePercent', (int)$storageInfo['relative']);
$tmpl->assign('isPublic', false);
-$tmpl->assign("encryptedFiles", \OCP\Util::encryptedFiles());
$tmpl->assign("mailNotificationEnabled", $config->getAppValue('core', 'shareapi_allow_mail_notification', 'no'));
$tmpl->assign("mailPublicNotificationEnabled", $config->getAppValue('core', 'shareapi_allow_public_notification', 'no'));
$tmpl->assign("allowShareWithLink", $config->getAppValue('core', 'shareapi_allow_links', 'yes'));
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index e63c3cad52e..9d2d563984e 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -126,7 +126,6 @@
return;
}
- var encryptedFiles = $('#encryptedFiles').val();
var initStatus = $('#encryptionInitStatus').val();
if (initStatus === '0') { // enc not initialized, but should be
OC.Notification.show(t('files', 'Encryption App is enabled but your keys are not initialized, please log-out and log-in again'));
@@ -134,11 +133,6 @@
}
if (initStatus === '1') { // encryption tried to init but failed
OC.Notification.show(t('files', 'Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files.'));
- return;
- }
- if (encryptedFiles === '1') {
- OC.Notification.show(t('files', 'Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files.'));
- return;
}
},
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index 222a996aae3..84f3033ba9e 100644
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -12,7 +12,6 @@
<input type="hidden" name="filesApp" id="filesApp" value="1" />
<input type="hidden" name="usedSpacePercent" id="usedSpacePercent" value="<?php p($_['usedSpacePercent']); ?>" />
<?php if (!$_['isPublic']) :?>
-<input type="hidden" name="encryptedFiles" id="encryptedFiles" value="<?php $_['encryptedFiles'] ? p('1') : p('0'); ?>" />
<input type="hidden" name="encryptedInitStatus" id="encryptionInitStatus" value="<?php p($_['encryptionInitStatus']) ?>" />
<input type="hidden" name="mailNotificationEnabled" id="mailNotificationEnabled" value="<?php p($_['mailNotificationEnabled']) ?>" />
<input type="hidden" name="mailPublicNotificationEnabled" id="mailPublicNotificationEnabled" value="<?php p($_['mailPublicNotificationEnabled']) ?>" />
diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php
index 58579f42dfc..a436973ba91 100644
--- a/lib/private/connector/sabre/file.php
+++ b/lib/private/connector/sabre/file.php
@@ -76,11 +76,6 @@ class File extends \OC\Connector\Sabre\Node implements \Sabre\DAV\IFile {
throw new \Sabre\DAV\Exception\ServiceUnavailable("File is not updatable: ".$e->getMessage());
}
- // throw an exception if encryption was disabled but the files are still encrypted
- if (\OC_Util::encryptedFiles()) {
- throw new \Sabre\DAV\Exception\ServiceUnavailable("Encryption is disabled");
- }
-
// verify path of the target
$this->verifyPath();
@@ -187,18 +182,13 @@ class File extends \OC\Connector\Sabre\Node implements \Sabre\DAV\IFile {
public function get() {
//throw exception if encryption is disabled but files are still encrypted
- if (\OC_Util::encryptedFiles()) {
- throw new \Sabre\DAV\Exception\ServiceUnavailable("Encryption is disabled");
- } else {
- try {
- return $this->fileView->fopen(ltrim($this->path, '/'), 'rb');
- } catch (\OCP\Encryption\Exception\EncryptionException $e) {
- throw new \Sabre\DAV\Exception\Forbidden($e->getMessage());
- } catch (\OCP\Files\StorageNotAvailableException $e) {
- throw new \Sabre\DAV\Exception\ServiceUnavailable("Failed to open file: ".$e->getMessage());
- }
+ try {
+ return $this->fileView->fopen(ltrim($this->path, '/'), 'rb');
+ } catch (\OCP\Encryption\Exception\EncryptionException $e) {
+ throw new \Sabre\DAV\Exception\Forbidden($e->getMessage());
+ } catch (\OCP\Files\StorageNotAvailableException $e) {
+ throw new \Sabre\DAV\Exception\ServiceUnavailable("Failed to open file: ".$e->getMessage());
}
-
}
/**
diff --git a/lib/private/util.php b/lib/private/util.php
index e6dd307faea..3fd0f844684 100644
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -812,51 +812,6 @@ class OC_Util {
return $errors;
}
-
- /**
- * check if there are still some encrypted files stored
- *
- * @return boolean
- */
- public static function encryptedFiles() {
- //check if encryption was enabled in the past
- $encryptedFiles = false;
- if (OC_App::isEnabled('files_encryption') === false) {
- $view = new OC\Files\View('/' . OCP\User::getUser());
- $keysPath = '/files_encryption/keys';
- if ($view->is_dir($keysPath)) {
- $dircontent = $view->getDirectoryContent($keysPath);
- if (!empty($dircontent)) {
- $encryptedFiles = true;
- }
- }
- }
-
- return $encryptedFiles;
- }
-
- /**
- * check if a backup from the encryption keys exists
- *
- * @return boolean
- */
- public static function backupKeysExists() {
- //check if encryption was enabled in the past
- $backupExists = false;
- if (OC_App::isEnabled('files_encryption') === false) {
- $view = new OC\Files\View('/' . OCP\User::getUser());
- $backupPath = '/files_encryption/backup.decryptAll';
- if ($view->is_dir($backupPath)) {
- $dircontent = $view->getDirectoryContent($backupPath);
- if (!empty($dircontent)) {
- $backupExists = true;
- }
- }
- }
-
- return $backupExists;
- }
-
/**
* Check for correct file permissions of data directory
*
diff --git a/lib/public/util.php b/lib/public/util.php
index b50ce54839b..37cb1b54485 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -219,9 +219,11 @@ class Util {
/**
* check if some encrypted files are stored
* @return bool
+ *
+ * @deprecated No longer required
*/
public static function encryptedFiles() {
- return \OC_Util::encryptedFiles();
+ return false;
}
/**
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 />