log if no mechanisms were used for password recovery

This commit is contained in:
David Goodwin committed 2019-02-12 13:35:34 +00:00
1 parent db4aecd23c
commit ed99a46ec4
1 file changed
+5 -2
+5 -2
View File
@@ -68,6 +68,7 @@ if ($_SERVER['REQUEST_METHOD'] === "POST") {
$handler = $context === 'admin' ? new AdminHandler : new MailboxHandler;
$token = $handler->getPasswordRecoveryCode($tUsername);
if ($token !== false) {
$table = table_by_key($context === 'users' ? 'mailbox' : 'admin');
$row = db_query_one("SELECT * FROM $table WHERE username= :username", array('username' => $username));
@@ -79,10 +80,12 @@ if ($_SERVER['REQUEST_METHOD'] === "POST") {
if ($email_other) {
sendCodeByEmail($email_other, $tUsername, $token);
}
if ($phone) {
elseif ($phone) {
sendCodeBySMS($phone, $tUsername, $token);
}
else {
error_log(__FILE__ . " - No mechanism configured for password-recovery.");
}
if ($email_other || $phone) {
header("Location: password-change.php?username=" . $tUsername);