aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_encryption/lib')
-rw-r--r--apps/files_encryption/lib/proxy.php2
-rw-r--r--apps/files_encryption/lib/util.php16
2 files changed, 17 insertions, 1 deletions
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index 31d11338ef5..b406404a688 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -54,7 +54,7 @@ class Proxy extends \OC_FileProxy {
$view = new \OC\Files\View();
// files outside of the files-folder are excluded
- if(strpos($path, '/' . $uid . '/files') !== 0) {
+ if(strpos($path, '/' . $uid . '/files/') !== 0) {
return true;
}
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index 087dada7f1b..33c2f88b0fd 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -1478,6 +1478,22 @@ class Util {
}
/**
+ * create a backup of all keys from the user
+ *
+ * @param string $purpose (optional) define the purpose of the backup, will be part of the backup folder
+ */
+ public function backupAllKeys($purpose = '') {
+ $this->userId;
+ $backupDir = $this->encryptionDir . '/backup.';
+ $backupDir .= ($purpose === '') ? date("Y-m-d_H-i-s") . '/' : $purpose . '.' . date("Y-m-d_H-i-s") . '/';
+ $this->view->mkdir($backupDir);
+ $this->view->copy($this->shareKeysPath, $backupDir . 'share-keys/');
+ $this->view->copy($this->keyfilesPath, $backupDir . 'keyfiles/');
+ $this->view->copy($this->privateKeyPath, $backupDir . $this->userId . '.private.key');
+ $this->view->copy($this->publicKeyPath, $backupDir . $this->userId . '.public.key');
+ }
+
+ /**
* check if the file is stored on a system wide mount point
* @param string $path relative to /data/user with leading '/'
* @return boolean