From 54f725ddb944b73d0d5082f6a51bd0775223864a Mon Sep 17 00:00:00 2001 From: Alexey Abel Date: Wed, 6 Jun 2018 14:55:25 +0200 Subject: [PATCH] Add first account assumption comment --- lib/Hooks/UserHooks.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Hooks/UserHooks.php b/lib/Hooks/UserHooks.php index 757d5fd..5ab60ed 100644 --- a/lib/Hooks/UserHooks.php +++ b/lib/Hooks/UserHooks.php @@ -140,6 +140,9 @@ class UserHooks { private function changeUserCallbackFunction() { return function (\OC\User\User $user, string $feature, string $value) { + // The assumption is made that the automatically created mail + // account is the first one, because it was automatically created + // immediately after the creation of the user. $firstAccountsMailAccount = $this->getUsersFirstMailAccount($user); if ($feature === 'displayName') { @@ -153,6 +156,9 @@ class UserHooks { private function changePasswordCallbackFunction() { return function (\OC\User\User $user, string $password) { + // The assumption is made that the automatically created mail + // account is the first one, because it was automatically created + // immediately after the creation of the user. $firstAccountsMailAccount = $this->getUsersFirstMailAccount($user); $firstAccountsMailAccount->setInboundPassword($this->encrypt($password)); $firstAccountsMailAccount->setOutboundPassword($this->encrypt($password));