diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-03-31 11:50:53 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-04-07 13:30:29 +0200 |
commit | bf809ac85aa6739010463235fe8f7878993c39ee (patch) | |
tree | 5fb347cb7e502f5622d7327c46cd69f1ec68efbc /lib | |
parent | 6ccd3ffa23882b7d5018d707d2563a12c418fc09 (diff) | |
download | nextcloud-server-bf809ac85aa6739010463235fe8f7878993c39ee.tar.gz nextcloud-server-bf809ac85aa6739010463235fe8f7878993c39ee.zip |
Removing left overs from old encryption app
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/connector/sabre/file.php | 22 | ||||
-rw-r--r-- | lib/private/util.php | 45 | ||||
-rw-r--r-- | lib/public/util.php | 4 |
3 files changed, 9 insertions, 62 deletions
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; } /** |