make sure that public-keys dir exists

This commit is contained in:
Björn Schießle 2013-04-10 16:46:02 +02:00
parent 4303d6318e
commit c3a284569b
1 changed files with 7 additions and 1 deletions

View 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