Don't resend confirm_address if profile is silenced

This commit is contained in:
Mikael Nordfeldth 2016-03-06 16:45:29 +01:00
parent e9516ea4dd
commit 47ae21c08e
1 changed files with 5 additions and 0 deletions

View File

@ -64,6 +64,11 @@ function mailConfirmAddress(Confirm_address $ca)
{
try {
$user = User::getByID($ca->user_id);
$profile = $user->getProfile();
if ($profile->isSilenced()) {
$ca->delete();
return;
}
if ($user->email === $ca->address) {
throw new AlreadyFulfilledException('User already has identical confirmed email address.');
}