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

View File

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