Loading lib/Service/RecoveryEmailService.php +17 −16 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ class RecoveryEmailService { public function validateRecoveryEmail(string $username, string $recoveryEmail) : bool { $user = $this->userManager->get($username); $email = $user->getEMailAddress(); if (!empty($recoveryEmail)) { if (!filter_var($recoveryEmail, FILTER_VALIDATE_EMAIL)) { $this->logger->info("User $username's requested recovery email does not match email format"); throw new InvalidRecoveryEmailException(); Loading @@ -74,14 +74,15 @@ class RecoveryEmailService { $this->logger->info("User ID $username's requested recovery email is the same as email"); throw new SameRecoveryEmailAsEmailException(); } if (!empty($recoveryEmail) && $this->isRecoveryEmailTaken($username, $recoveryEmail)) { if ($this->isRecoveryEmailTaken($username, $recoveryEmail)) { $this->logger->info("User ID $username's requested recovery email address is already taken"); throw new RecoveryEmailAlreadyFoundException(); } if (!empty($recoveryEmail) && $this->isRecoveryEmailDomainDisallowed($recoveryEmail)) { if ($this->isRecoveryEmailDomainDisallowed($recoveryEmail)) { $this->logger->info("User ID $username's requested recovery email address is disallowed."); throw new MurenaDomainDisallowedException(); } } return true; } public function isRecoveryEmailDomainDisallowed(string $recoveryEmail): bool { Loading Loading
lib/Service/RecoveryEmailService.php +17 −16 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ class RecoveryEmailService { public function validateRecoveryEmail(string $username, string $recoveryEmail) : bool { $user = $this->userManager->get($username); $email = $user->getEMailAddress(); if (!empty($recoveryEmail)) { if (!filter_var($recoveryEmail, FILTER_VALIDATE_EMAIL)) { $this->logger->info("User $username's requested recovery email does not match email format"); throw new InvalidRecoveryEmailException(); Loading @@ -74,14 +74,15 @@ class RecoveryEmailService { $this->logger->info("User ID $username's requested recovery email is the same as email"); throw new SameRecoveryEmailAsEmailException(); } if (!empty($recoveryEmail) && $this->isRecoveryEmailTaken($username, $recoveryEmail)) { if ($this->isRecoveryEmailTaken($username, $recoveryEmail)) { $this->logger->info("User ID $username's requested recovery email address is already taken"); throw new RecoveryEmailAlreadyFoundException(); } if (!empty($recoveryEmail) && $this->isRecoveryEmailDomainDisallowed($recoveryEmail)) { if ($this->isRecoveryEmailDomainDisallowed($recoveryEmail)) { $this->logger->info("User ID $username's requested recovery email address is disallowed."); throw new MurenaDomainDisallowedException(); } } return true; } public function isRecoveryEmailDomainDisallowed(string $recoveryEmail): bool { Loading