0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-20 03:36:20 +02:00

pass Login instance into TotpPf

This commit is contained in:
David Goodwin 2024-01-01 22:43:55 +00:00
parent bbb6e85904
commit fc8e7cc271
No known key found for this signature in database

View File

@ -47,7 +47,8 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
die('Invalid token!');
}
$totppf = new TotpPf('mailbox');
$login = new Login('mailbox');
$totppf = new TotpPf('mailbox', $login);
$lang = safepost('lang');
$fUsername = trim(safepost('fUsername'));
@ -59,7 +60,6 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
# (language preference cookie is processed even if username and/or password are invalid)
}
$login = new Login('mailbox');
if ($login->login($fUsername, $fPassword)) {
if ($totppf->usesTOTP($fUsername)) {
init_session($fUsername, false, false);