Loading lib/Controller/AccountController.php +1 −1 Original line number Diff line number Diff line Loading @@ -171,7 +171,7 @@ class AccountController extends Controller { } catch (RecoveryEmailValidationException $e) { $this->logger->logException($e, ['app' => Application::APP_ID]); $response->setData(['message' => $e->getMessage(), 'success' => false]); $response->setStatus(500); $response->setStatus(400); } catch (AddUsernameToCommonStoreException $e) { $this->logger->logException($e, ['app' => Application::APP_ID]); $response->setStatus(200); Loading lib/Event/BeforeUserRegisteredEvent.php +11 −1 Original line number Diff line number Diff line Loading @@ -37,8 +37,12 @@ class BeforeUserRegisteredEvent extends Event { private $recoveryMailAddress; private $language; private $username; private $displayName; public function __construct(string $recoveryMailAddress, string $language) { public function __construct(string $username, string $displayName, string $recoveryMailAddress, string $language) { $this->username = $username; $this->displayName = $displayName; $this->recoveryMailAddress = $recoveryMailAddress; $this->language = $language; } Loading @@ -49,4 +53,10 @@ class BeforeUserRegisteredEvent extends Event { public function getLanguage(): string { return $this->language; } public function getUsername(): string { return $this->username; } public function getDisplayName(): string { return $this->displayName; } } lib/Service/UserService.php +1 −3 Original line number Diff line number Diff line Loading @@ -253,9 +253,7 @@ class UserService { if ($this->userExists($username) || $this->isUsernameTaken($username)) { throw new Exception("Username '$username' is already taken."); } if (!empty($recoveryEmail)) { $this->dispatcher->dispatchTyped(new BeforeUserRegisteredEvent($recoveryEmail, $language)); } $this->dispatcher->dispatchTyped(new BeforeUserRegisteredEvent($username, $displayname, $recoveryEmail, $language)); $this->addNewUserToLDAP($displayname, $username, $userEmail, $password); } /** Loading Loading
lib/Controller/AccountController.php +1 −1 Original line number Diff line number Diff line Loading @@ -171,7 +171,7 @@ class AccountController extends Controller { } catch (RecoveryEmailValidationException $e) { $this->logger->logException($e, ['app' => Application::APP_ID]); $response->setData(['message' => $e->getMessage(), 'success' => false]); $response->setStatus(500); $response->setStatus(400); } catch (AddUsernameToCommonStoreException $e) { $this->logger->logException($e, ['app' => Application::APP_ID]); $response->setStatus(200); Loading
lib/Event/BeforeUserRegisteredEvent.php +11 −1 Original line number Diff line number Diff line Loading @@ -37,8 +37,12 @@ class BeforeUserRegisteredEvent extends Event { private $recoveryMailAddress; private $language; private $username; private $displayName; public function __construct(string $recoveryMailAddress, string $language) { public function __construct(string $username, string $displayName, string $recoveryMailAddress, string $language) { $this->username = $username; $this->displayName = $displayName; $this->recoveryMailAddress = $recoveryMailAddress; $this->language = $language; } Loading @@ -49,4 +53,10 @@ class BeforeUserRegisteredEvent extends Event { public function getLanguage(): string { return $this->language; } public function getUsername(): string { return $this->username; } public function getDisplayName(): string { return $this->displayName; } }
lib/Service/UserService.php +1 −3 Original line number Diff line number Diff line Loading @@ -253,9 +253,7 @@ class UserService { if ($this->userExists($username) || $this->isUsernameTaken($username)) { throw new Exception("Username '$username' is already taken."); } if (!empty($recoveryEmail)) { $this->dispatcher->dispatchTyped(new BeforeUserRegisteredEvent($recoveryEmail, $language)); } $this->dispatcher->dispatchTyped(new BeforeUserRegisteredEvent($username, $displayname, $recoveryEmail, $language)); $this->addNewUserToLDAP($displayname, $username, $userEmail, $password); } /** Loading