From f2f77b2b09a12f34a42319d2edee8ba7448f3e5f Mon Sep 17 00:00:00 2001 From: Herman van Rink <rink@initfour.nl> Date: Thu, 19 May 2022 13:36:11 +0200 Subject: [PATCH] Fix indend and add comment --- interface/web/login/otp.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/interface/web/login/otp.php b/interface/web/login/otp.php index d149714cc8..53490318d0 100644 --- a/interface/web/login/otp.php +++ b/interface/web/login/otp.php @@ -129,6 +129,7 @@ if($_SESSION['otp']['type'] == 'email') { // Send code via email. if (!isset($_SESSION['otp']['sent']) || $_GET['action'] == 'resend') { + // Handle otp_email_override. $sys_user = $app->db->queryOneRecord('SELECT otp_data FROM sys_user WHERE userid = ?', $_SESSION['s_pending']['user']['userid']); $data = json_decode($sys_user['otp_data'], TRUE); @@ -136,14 +137,14 @@ if($_SESSION['otp']['type'] == 'email') { $email_to = $data['otp_email_override']; } else { - $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']); - if (!empty($clientuser['email'])) { - $email_to = $clientuser['email']; - } - else { - // Admin users are not related to a client, thus use the globally configured email address. - $email_to = $mail_config['admin_mail']; - } + $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']); + if (!empty($clientuser['email'])) { + $email_to = $clientuser['email']; + } + else { + // Admin users are not related to a client, thus use the globally configured email address. + $email_to = $mail_config['admin_mail']; + } } $mail_otp_code_retry_timeout = 30; -- GitLab