]> source.dussan.org Git - nextcloud-server.git/commitdiff
add method to check if users private/public key exists
authorBjoern Schiessle <schiessle@owncloud.com>
Thu, 5 Dec 2013 17:49:55 +0000 (18:49 +0100)
committerBjoern Schiessle <schiessle@owncloud.com>
Fri, 6 Dec 2013 11:20:14 +0000 (12:20 +0100)
apps/files_encryption/lib/util.php

index 434ed225644368dc0ede89fd1c655a9db9922037..ed2c5aab92607c20052b338b2e1f635b817c7d7c 100644 (file)
@@ -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;
+               }
        }
 
        /**