Skip to content

Commit 29ef452

Browse files
committed
Print that we sent an email
1 parent 62e6449 commit 29ef452

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

interface/web/login/lib/lang/en.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ $wb['lost_password_function_denied_txt'] = 'This activation link is not valid.';
3535
$wb['otp_code_txt'] = 'Two Factor Authentication';
3636
$wb['otp_code_desc_txt'] = 'Enter the code you got from your authenticator app or via email.';
3737
$wb['otp_code_placeholder_txt'] = 'OTP code';
38+
$wb['otp_code_email_sent_txt'] = 'An email was sent to';
3839
$wb['otp_code_resend_txt'] = 'Request new code';
3940
?>

interface/web/login/otp.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
$app->auth->csrf_token_check();
5656
}
5757

58+
require ISPC_ROOT_PATH.'/web/login/lib/lang/'.$app->functions->check_language($conf['language']).'.lng';
5859

5960
function finish_2fa_success($msg = '') {
6061
global $app;
@@ -162,6 +163,7 @@ function finish_2fa_success($msg = '') {
162163
} else {
163164
$_SESSION['otp']['sent']++;
164165
}
166+
$token_sent_message = $wb['otp_code_email_sent_txt'] . ' ' . $email_to;
165167

166168
}
167169

@@ -183,7 +185,9 @@ function finish_2fa_success($msg = '') {
183185
$app->tpl->setVar('base64_logo_txt', $base64_logo_txt);
184186

185187
$app->tpl->setVar('current_theme', isset($_SESSION['s']['theme']) ? $_SESSION['s']['theme'] : 'default', true);
186-
188+
if (!empty($token_sent_message)) {
189+
$app->tpl->setVar('token_sent_message', $token_sent_message);
190+
}
187191

188192
//* Load templating system and lang file
189193
$app->uses('tpl');
@@ -197,7 +201,6 @@ function finish_2fa_success($msg = '') {
197201
$app->tpl->setVar('_csrf_key',$csrf_token['csrf_key']);
198202
//$app->tpl->setVar('msg', print_r($_SESSION['otp'], 1)); // For DEBUG only.
199203

200-
require ISPC_ROOT_PATH.'/web/login/lib/lang/'.$app->functions->check_language($conf['language']).'.lng';
201204
$app->tpl->setVar($wb);
202205

203206
$app->tpl_defaults();

interface/web/login/templates/otp.htm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ <h2><tmpl_var name="otp_code_txt"></h2>
1414
<div class="right">
1515
<input class="btn btn-default formbutton-default" type="submit" value="{tmpl_var name='login_button_txt'}">
1616
</div>
17+
<tmpl_if name="token_sent_message">{tmpl_var name='token_sent_message'}<br /></tmpl_if>
1718
<a href="otp.php?action=resend">{tmpl_var name='otp_code_resend_txt'}</a>
1819

1920

0 commit comments

Comments
 (0)