Skip to content

Commit c7f61ad

Browse files
committed
Admin users are not related to a client, thus use the globally configured email address.
1 parent 7436c4d commit c7f61ad

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

interface/web/login/otp.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,13 @@ function finish_2fa_success($msg = '') {
151151
}
152152

153153
$clientuser = $app->db->queryOneRecord('SELECT email FROM sys_user u LEFT JOIN client c ON (u.client_id=c.client_id) WHERE u.userid = ?', $_SESSION['s_pending']['user']['userid']);
154-
$email_to = $clientuser['email'];
154+
if (!empty($clientuser['email'])) {
155+
$email_to = $clientuser['email'];
156+
}
157+
else {
158+
// Admin users are not related to a client, thus use the globally configured email address.
159+
$email_to = $mail_config['admin_mail'];
160+
}
155161

156162
$app->ispcmail->setSender($mail_config['admin_mail'], $mail_config['admin_name']);
157163
$app->ispcmail->setSubject($wb['otp_code_email_subject_txt']);

0 commit comments

Comments
 (0)