Loading lib/Service/UserService.php +20 −10 Original line number Diff line number Diff line Loading @@ -247,6 +247,19 @@ class UserService { throw new Exception("Username is already taken."); } if (!empty($recoveryEmail)) { $this->validateRecoveryEmail($recoveryEmail); } return $this->addNewUserToLDAP($displayname, $recoveryEmail, $username, $userEmail, $password); } /** * Validates the recovery email address. * * @param string $recoveryEmail The recovery email address to be validated. * @throws Exception If the recovery email address has an incorrect format, is already taken, or if the domain is disallowed. * @return void */ public function validateRecoveryEmail(string $recoveryEmail): void { if (!$this->isValidEmailFormat($recoveryEmail)) { throw new Exception('Recovery email address has an incorrect format.'); } Loading @@ -257,9 +270,6 @@ class UserService { throw new Exception('You cannot set an email address with a Murena domain as recovery email address.'); } } return $this->addNewUserToLDAP($displayname, $recoveryEmail, $username, $userEmail, $password); } /** * Add a new user to the LDAP directory. * Loading Loading
lib/Service/UserService.php +20 −10 Original line number Diff line number Diff line Loading @@ -247,6 +247,19 @@ class UserService { throw new Exception("Username is already taken."); } if (!empty($recoveryEmail)) { $this->validateRecoveryEmail($recoveryEmail); } return $this->addNewUserToLDAP($displayname, $recoveryEmail, $username, $userEmail, $password); } /** * Validates the recovery email address. * * @param string $recoveryEmail The recovery email address to be validated. * @throws Exception If the recovery email address has an incorrect format, is already taken, or if the domain is disallowed. * @return void */ public function validateRecoveryEmail(string $recoveryEmail): void { if (!$this->isValidEmailFormat($recoveryEmail)) { throw new Exception('Recovery email address has an incorrect format.'); } Loading @@ -257,9 +270,6 @@ class UserService { throw new Exception('You cannot set an email address with a Murena domain as recovery email address.'); } } return $this->addNewUserToLDAP($displayname, $recoveryEmail, $username, $userEmail, $password); } /** * Add a new user to the LDAP directory. * Loading