Browse Source

replaceUserKeys() actually deletes the users keys -> update method name and doc-block

tags/v9.1.0beta1
Bjoern Schiessle 8 years ago
parent
commit
89223379ad

+ 1
- 1
apps/encryption/hooks/userhooks.php View File

@@ -296,7 +296,7 @@ class UserHooks implements IHook {
public function postPasswordReset($params) {
$password = $params['password'];

$this->keyManager->replaceUserKeys($params['uid']);
$this->keyManager->deleteUserKeys($params['uid']);
$this->userSetup->setupUser($params['uid'], $password);
}


+ 3
- 1
apps/encryption/lib/keymanager.php View File

@@ -557,9 +557,11 @@ class KeyManager {
}

/**
* creat a backup of the users private and public key and then delete it
*
* @param string $uid
*/
public function replaceUserKeys($uid) {
public function deleteUserKeys($uid) {
$this->backupAllKeys('password_reset');
$this->deletePublicKey($uid);
$this->deletePrivateKey($uid);

+ 1
- 1
apps/encryption/tests/hooks/UserHooksTest.php View File

@@ -251,7 +251,7 @@ class UserHooksTest extends TestCase {

public function testPostPasswordReset() {
$this->keyManagerMock->expects($this->once())
->method('replaceUserKeys')
->method('deleteUserKeys')
->with('testUser');

$this->userSetupMock->expects($this->once())

Loading…
Cancel
Save