]> source.dussan.org Git - nextcloud-server.git/commitdiff
make sure that public-keys dir exists
authorBjörn Schießle <schiessle@owncloud.com>
Wed, 10 Apr 2013 14:46:02 +0000 (16:46 +0200)
committerBjörn Schießle <schiessle@owncloud.com>
Wed, 10 Apr 2013 14:46:02 +0000 (16:46 +0200)
apps/files_encryption/lib/session.php

index 7bfea7bed483dbe277b153b2b776a229eb882ee3..0c6a7131fd9b6fa0d205a70a1f2af1785d03fcc5 100644 (file)
@@ -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