--- loncom/interface/resetpw.pm 2021/05/04 18:47:36 1.49
+++ loncom/interface/resetpw.pm 2025/02/15 03:43:36 1.54
@@ -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.49 2021/05/04 18:47:36 raeburn Exp $
+# $Id: resetpw.pm,v 1.54 2025/02/15 03:43:36 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)) {
@@ -288,12 +289,13 @@ END
$js.= "\n".''."\n";
}
my $header = &Apache::loncommon::start_page('Reset password',$js,$args).
- '
'.&mt('Reset forgotten LON-CAPA password').'
';
+ ''.
+ '
'.&mt('Reset forgotten LON-CAPA password').'
';
my $output;
if ($token) {
- $r->print($header);
- &reset_passwd($r,$token,$contact_name,$contact_email,\%passwdconf);
- $r->print(&Apache::loncommon::end_page());
+ $r->print($header.'');
+ &reset_passwd($r,$token,$contact_name,$contact_email,$clientip,\%passwdconf);
+ $r->print('
'.&Apache::loncommon::end_page());
return OK;
} elsif ($udom) {
if (!$domdesc) {
@@ -327,7 +329,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);
@@ -417,7 +419,7 @@ END
} else {
$output = &get_uname($server,$defdom,\%passwdconf);
}
- $r->print($header.$output);
+ $r->print($header.''.$output.'
');
$r->print(&Apache::loncommon::end_page());
return OK;
}
@@ -441,22 +443,22 @@ sub get_uname {
$msg .= $contents;
}
}
- $msg .= ''.&mt('Three conditions must be met:')
+ $msg .= '
'.&mt('Three conditions must be met:').'
'
.'- '.&mt('An e-mail address must have previously been associated with your LON-CAPA username.').'
'
.'- '.&mt('You must be able to access e-mail sent to that address.').'
'
- .'- '.&mt('Your LON-CAPA account must be of a type for which LON-CAPA can reset a password.')
- .'
';
+ .''.&mt('Your LON-CAPA account must be of a type for which LON-CAPA can reset a password.').''
+ .'';
my $onchange = 'javascript:verifyDomain(this,this.form);';
$msg .= '