From d0afd774b7725f8f32bd8eb2b67aaac0435f41e2 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 5 Dec 2013 18:49:55 +0100 Subject: [PATCH 1/4] add method to check if users private/public key exists --- apps/files_encryption/lib/util.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php index 434ed225644..ed2c5aab926 100644 --- a/apps/files_encryption/lib/util.php +++ b/apps/files_encryption/lib/util.php @@ -101,15 +101,24 @@ class Util { or !$this->view->file_exists($this->publicKeyPath) or !$this->view->file_exists($this->privateKeyPath) ) { - return false; - } else { - return true; - } + } + /** + * @breif check if the users private & public key exists + * @return boolean + */ + public function userKeysExists() { + if ( + $this->view->file_exists($this->privateKeyPath) && + $this->view->file_exists($this->publicKeyPath)) { + return true; + } else { + return false; + } } /** From 418d401bf9b63cab7b5a65657d6f99a84933cede Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 5 Dec 2013 18:50:52 +0100 Subject: [PATCH 2/4] show change password form if key couldn't be decrypted --- apps/files_encryption/templates/settings-personal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_encryption/templates/settings-personal.php b/apps/files_encryption/templates/settings-personal.php index a4ed89b8a49..1b4239d82cd 100644 --- a/apps/files_encryption/templates/settings-personal.php +++ b/apps/files_encryption/templates/settings-personal.php @@ -2,7 +2,7 @@

t( 'Encryption' ) ); ?>

- +