summaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib/users/setup.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/encryption/lib/users/setup.php')
-rw-r--r--apps/encryption/lib/users/setup.php22
1 files changed, 8 insertions, 14 deletions
diff --git a/apps/encryption/lib/users/setup.php b/apps/encryption/lib/users/setup.php
index 0b5fb351aca..e59340c4ce2 100644
--- a/apps/encryption/lib/users/setup.php
+++ b/apps/encryption/lib/users/setup.php
@@ -66,29 +66,23 @@ class Setup {
}
/**
- * @param string $uid userid
+ * @param string $uid user id
* @param string $password user password
* @return bool
*/
public function setupUser($uid, $password) {
- return $this->setupServerSide($uid, $password);
+ if (!$this->keyManager->userHasKeys($uid)) {
+ return $this->keyManager->storeKeyPair($uid, $password,
+ $this->crypt->createKeyPair());
+ }
+ return true;
}
/**
- * check if user has a key pair, if not we create one
- *
- * @param string $uid userid
- * @param string $password user password
- * @return bool
+ * make sure that all system keys exists
*/
- public function setupServerSide($uid, $password) {
+ public function setupSystem() {
$this->keyManager->validateShareKey();
$this->keyManager->validateMasterKey();
- // Check if user already has keys
- if (!$this->keyManager->userHasKeys($uid)) {
- return $this->keyManager->storeKeyPair($uid, $password,
- $this->crypt->createKeyPair());
- }
- return true;
}
}