mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2026-11-20 23:43:26 +03:00
log if no mechanisms were used for password recovery
This commit is contained in:
1 parent
db4aecd23c
commit
ed99a46ec4
1 file changed
+5
-2
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user