version 1.49, 2021/05/04 18:47:36
|
version 1.50, 2021/11/30 15:55:37
|
Line 115 sub handler {
|
Line 115 sub handler {
|
} |
} |
} |
} |
my %passwdconf = &Apache::lonnet::get_passwdconf($dom_in_effect); |
my %passwdconf = &Apache::lonnet::get_passwdconf($dom_in_effect); |
|
my $clientip = &Apache::lonnet::get_requestor_ip($r); |
my $token = $env{'form.token'}; |
my $token = $env{'form.token'}; |
my $useremail = $env{'form.useremail'}; |
my $useremail = $env{'form.useremail'}; |
if (($udom ne '') && (!$otherinst) && (!$token)) { |
if (($udom ne '') && (!$otherinst) && (!$token)) { |
Line 292 END
|
Line 293 END
|
my $output; |
my $output; |
if ($token) { |
if ($token) { |
$r->print($header); |
$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()); |
$r->print(&Apache::loncommon::end_page()); |
return OK; |
return OK; |
} elsif ($udom) { |
} elsif ($udom) { |
Line 327 END
|
Line 328 END
|
my $authtype = &Apache::lonnet::queryauthenticate($uname,$udom); |
my $authtype = &Apache::lonnet::queryauthenticate($uname,$udom); |
if ($authtype =~ /^internal/) { |
if ($authtype =~ /^internal/) { |
my ($blocked,$blocktext) = |
my ($blocked,$blocktext) = |
&Apache::loncommon::blocking_status('passwd',$uname,$udom); |
&Apache::loncommon::blocking_status('passwd',$clentip,$uname,$udom); |
if ($blocked) { |
if ($blocked) { |
$output = '<p class="LC_warning">'.$blocktext.'</p>' |
$output = '<p class="LC_warning">'.$blocktext.'</p>' |
.&display_actions($contact_email,$domdesc); |
.&display_actions($contact_email,$domdesc); |
Line 604 sub homeserver_redirect {
|
Line 605 sub homeserver_redirect {
|
} |
} |
|
|
sub reset_passwd { |
sub reset_passwd { |
my ($r,$token,$contact_name,$contact_email,$passwdconf) = @_; |
my ($r,$token,$contact_name,$contact_email,$clientip,$passwdconf) = @_; |
return unless (ref($passwdconf) eq 'HASH'); |
return unless (ref($passwdconf) eq 'HASH'); |
my %data = &Apache::lonnet::tmpget($token); |
my %data = &Apache::lonnet::tmpget($token); |
my $now = time; |
my $now = time; |
Line 625 sub reset_passwd {
|
Line 626 sub reset_passwd {
|
} |
} |
my $reqtime = &Apache::lonlocal::locallocaltime($data{'time'}); |
my $reqtime = &Apache::lonlocal::locallocaltime($data{'time'}); |
my ($blocked,$blocktext) = |
my ($blocked,$blocktext) = |
&Apache::loncommon::blocking_status('passwd',$data{'username'},$data{'domain'}); |
&Apache::loncommon::blocking_status('passwd',$clientip,$data{'username'},$data{'domain'}); |
if ($blocked) { |
if ($blocked) { |
$r->print('<p class="LC_warning">'.$blocktext.'</p>'); |
$r->print('<p class="LC_warning">'.$blocktext.'</p>'); |
return; |
return; |
Line 792 sub reset_passwd {
|
Line 793 sub reset_passwd {
|
delete($env{'form.udom'}); |
delete($env{'form.udom'}); |
} |
} |
} else { |
} else { |
|
#FIXME |
$r->print(&mt('The token included in an e-mail sent to you [_1] has been verified, so you may now proceed to reset the password for your LON-CAPA account.',$reqtime).'<br /><br />'); |
$r->print(&mt('The token included in an e-mail sent to you [_1] has been verified, so you may now proceed to reset the password for your LON-CAPA account.',$reqtime).'<br /><br />'); |
if (keys(%formfields)) { |
if (keys(%formfields)) { |
if (($formfields{'username'}) && ($formfields{'email'})) { |
if (($formfields{'username'}) && ($formfields{'email'})) { |