aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib/session.php
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-04-10 16:46:02 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-04-10 16:46:02 +0200
commitc3a284569b5a6f83104cf3b5f0a52b2ecfffd8c2 (patch)
treeb5aff5d1acdf50d81e54c916db1f2de11098e682 /apps/files_encryption/lib/session.php
parent4303d6318ebf04929a74e1b08e3fad82e1be3a31 (diff)
downloadnextcloud-server-c3a284569b5a6f83104cf3b5f0a52b2ecfffd8c2.tar.gz
nextcloud-server-c3a284569b5a6f83104cf3b5f0a52b2ecfffd8c2.zip
make sure that public-keys dir exists
Diffstat (limited to 'apps/files_encryption/lib/session.php')
-rw-r--r--apps/files_encryption/lib/session.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files_encryption/lib/session.php b/apps/files_encryption/lib/session.php
index 7bfea7bed48..0c6a7131fd9 100644
--- a/apps/files_encryption/lib/session.php
+++ b/apps/files_encryption/lib/session.php
@@ -38,7 +38,8 @@ class Session {
public function __construct( \OC_FilesystemView $view ) {
$this->view = $view;
-
+
+
if ( ! $this->view->is_dir( 'owncloud_private_key' ) ) {
$this->view->mkdir('owncloud_private_key');
@@ -55,6 +56,11 @@ class Session {
\OC_FileProxy::$enabled = false;
// Save public key
+
+ if (!$view->is_dir('/public-keys')) {
+ $view->mkdir('/public-keys');
+ }
+
$this->view->file_put_contents( '/public-keys/owncloud.public.key', $keypair['publicKey'] );
// Encrypt private key empthy passphrase