Skip to content

Commit 7d0a2f2

Browse files
Merge pull request #23 from LibreSign/chore/allow-to-always-check-if-need-to-update-user-data
chore: allow to always check if need to update user data
2 parents 868f37c + f9604a2 commit 7d0a2f2

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/Controller/AdminGroupController.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,13 @@ private function addSubAdmin(IUser $user, IGroup $group): void {
165165

166166
private function createUser($userId, $displayName, $email): IUser {
167167
$user = $this->userManager->get($userId);
168-
if ($user instanceof IUser) {
169-
return $user;
170-
}
171-
$passwordEvent = new GenerateSecurePasswordEvent();
172-
$this->eventDispatcher->dispatchTyped($passwordEvent);
173-
$password = $passwordEvent->getPassword() ?? $this->secureRandom->generate(20);
168+
if (!$user instanceof IUser) {
169+
$passwordEvent = new GenerateSecurePasswordEvent();
170+
$this->eventDispatcher->dispatchTyped($passwordEvent);
171+
$password = $passwordEvent->getPassword() ?? $this->secureRandom->generate(20);
174172

175-
$user = $this->userManager->createUser($userId, $password);
173+
$user = $this->userManager->createUser($userId, $password);
174+
}
176175

177176
if ($displayName !== '') {
178177
try {

0 commit comments

Comments
 (0)