Add logging for password resets

This commit is contained in:
Jamie Cameron
2025-04-26 10:04:43 -07:00
parent 924e7e8ff5
commit 4fbc57350f
4 changed files with 13 additions and 0 deletions

View File

@ -249,6 +249,8 @@ log_sync=Changed unix user synchronization
log_sql=Changed user and group database
log_twofactor=Enrolled user $1 with two-factor provider $2
log_onefactor=Dis-enrolled user $1 for two-factor authentication
log_forgot_send=Sent password rest email for $1 to $2
log_forgot_reset=Reset password for $1 with email $2
gedit_ecannot=You are not allowed to edit groups
gedit_title=Edit Webmin Group

View File

@ -62,6 +62,10 @@ elsif ($action eq 'switch') {
elsif ($action eq 'twofactor') {
return &text('log_twofactor', $object, $p->{'provider'}, $p->{'id'});
}
elsif ($action eq 'forgot') {
return &text('log_forgot_'.$type, &html_escape($p->{'user'}),
&html_escape($p->{'email'}));
}
else {
return $text{'log_'.$action};
}

View File

@ -118,6 +118,10 @@ if (defined($in{'newpass'})) {
}
print &text('forgot_retry', '/'),"<p>\n";
&webmin_log("forgot", "reset", undef,
{ 'user' => $wuser->{'name'},
'email' => $link{'email'} }, "acl");
&unlink_file("$main::forgot_password_link_dir/$in{'id'}");
}
else {

View File

@ -101,6 +101,9 @@ print &text('forgot_sent',
"<tt>".&html_escape($wuser->{'name'})."</tt>"),"<p>\n";
print "</center>\n";
&webmin_log("forgot", "send", undef,
{ 'user' => $wuser->{'name'},
'email' => $email }, "acl");
&ui_print_footer();
# generate_random_id()