--- loncom/interface/resetpw.pm 2019/04/26 20:22:18 1.45 +++ loncom/interface/resetpw.pm 2025/02/14 19:01:11 1.52 @@ -1,7 +1,7 @@ # The LearningOnline Network # Allow access to password changing via a token sent to user's e-mail. # -# $Id: resetpw.pm,v 1.45 2019/04/26 20:22:18 raeburn Exp $ +# $Id: resetpw.pm,v 1.52 2025/02/14 19:01:11 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -115,6 +115,7 @@ sub handler { } } my %passwdconf = &Apache::lonnet::get_passwdconf($dom_in_effect); + my $clientip = &Apache::lonnet::get_requestor_ip($r); my $token = $env{'form.token'}; my $useremail = $env{'form.useremail'}; if (($udom ne '') && (!$otherinst) && (!$token)) { @@ -292,7 +293,7 @@ END my $output; if ($token) { $r->print($header); - &reset_passwd($r,$token,$contact_name,$contact_email,\%passwdconf); + &reset_passwd($r,$token,$contact_name,$contact_email,$clientip,\%passwdconf); $r->print(&Apache::loncommon::end_page()); return OK; } elsif ($udom) { @@ -300,12 +301,12 @@ END $output = &invalid_state('baddomain',$domdesc, $contact_name,$contact_email); } elsif ($otherinst) { - ($header,$output) = &homeserver_redirect($uname,$udom,$domdesc,$brcrum); + ($header,$output) = &homeserver_redirect($r,$uname,$udom,$domdesc,$brcrum); } elsif (($uname) || ($useremail)) { my $earlyout; unless ($passwdconf{'captcha'} eq 'unused') { my ($captcha_chk,$captcha_error) = - &Apache::loncommon::captcha_response('passwords',$server); + &Apache::loncommon::captcha_response('passwords',$server,$dom_in_effect); if ($captcha_chk != 1) { my $error = 'captcha'; if ($passwdconf{'captcha'} eq 'recaptcha') { @@ -327,7 +328,7 @@ END my $authtype = &Apache::lonnet::queryauthenticate($uname,$udom); if ($authtype =~ /^internal/) { my ($blocked,$blocktext) = - &Apache::loncommon::blocking_status('passwd',$uname,$udom); + &Apache::loncommon::blocking_status('passwd',$clientip,$uname,$udom); if ($blocked) { $output = '
'.$blocktext.'
' .&display_actions($contact_email,$domdesc); @@ -359,7 +360,7 @@ END } foreach my $item (@items) { if ($item =~ /^[^\@]+\@[^\@]+\.[^\@\.]+$/) { - unless (grep(/^\Q$item\E$/i,@allemails)) { + unless (grep(/^\Q$item\E$/i,@allemails)) { push(@allemails,$item); } } @@ -441,11 +442,11 @@ sub get_uname { $msg .= $contents; } } - $msg .= ''.&mt('Three conditions must be met:') + $msg .= '
'.&mt('Three conditions must be met:').'
' .'