version 1.33, 2013/07/19 16:17:07
|
version 1.37, 2016/01/27 00:24:09
|
Line 116 sub handler {
|
Line 116 sub handler {
|
my $authtype = &Apache::lonnet::queryauthenticate($uname,$udom); |
my $authtype = &Apache::lonnet::queryauthenticate($uname,$udom); |
if ($authtype =~ /^internal/) { |
if ($authtype =~ /^internal/) { |
my $useremail = $env{'form.useremail'}; |
my $useremail = $env{'form.useremail'}; |
if ($useremail !~ /^[^\@]+\@[^\@]+\.[^\@\.]+$/) { |
my ($blocked,$blocktext) = |
$output = &invalid_state('baduseremail',$domdesc, |
&Apache::loncommon::blocking_status('passwd',$uname,$udom); |
$contact_name,$contact_email); |
if ($blocked) { |
|
$output = '<p class="LC_warning">'.$blocktext.'</p>' |
|
.&display_actions($contact_email,$domdesc); |
|
} elsif ($useremail !~ /^[^\@]+\@[^\@]+\.[^\@\.]+$/) { |
|
$output = &invalid_state('baduseremail',$domdesc, |
|
$contact_name,$contact_email); |
} else { |
} else { |
my %userinfo = |
my %userinfo = |
&Apache::lonnet::get('environment',\@emailtypes, |
&Apache::lonnet::get('environment',\@emailtypes, |
Line 225 sub send_token {
|
Line 230 sub send_token {
|
my $result = &send_mail($domdesc,$email,$mailmsg,$contact_name, |
my $result = &send_mail($domdesc,$email,$mailmsg,$contact_name, |
$contact_email); |
$contact_email); |
if ($result eq 'ok') { |
if ($result eq 'ok') { |
$msg .= &mt("An e-mail sent to the e-mail address associated with your LON-CAPA account includes the web address for the link you should use to complete the reset process.<br /><br />The link included in the message will be valid for the next <b>two</b> hours."); |
$msg .= |
|
&mt('An e-mail sent to the e-mail address associated with your LON-CAPA account includes the web address for the link you should use to complete the reset process.') |
|
.'<br /><br />' |
|
.&mt('The link included in the message will be valid for the next [_1]two[_2] hours.','<b>','</b>'); |
} else { |
} else { |
$msg .= |
$msg .= |
'<p class="LC_error">' |
'<p class="LC_error">' |
Line 233 sub send_token {
|
Line 241 sub send_token {
|
.' associated with your LON-CAPA account.') |
.' associated with your LON-CAPA account.') |
.'</p>' |
.'</p>' |
.&display_actions($contact_email,$domdesc); |
.&display_actions($contact_email,$domdesc); |
|
|
} |
} |
} else { |
} else { |
$msg .= |
$msg .= |
Line 308 sub reset_passwd {
|
Line 315 sub reset_passwd {
|
($data{'email'} =~ /^[^\@]+\@[^\@]+\.[^\@\.]+$/) && |
($data{'email'} =~ /^[^\@]+\@[^\@]+\.[^\@\.]+$/) && |
($data{'temppasswd'} =~/^\w+$/)) { |
($data{'temppasswd'} =~/^\w+$/)) { |
my $reqtime = &Apache::lonlocal::locallocaltime($data{'time'}); |
my $reqtime = &Apache::lonlocal::locallocaltime($data{'time'}); |
if ($now - $data{'time'} < 7200) { |
my ($blocked,$blocktext) = |
|
&Apache::loncommon::blocking_status('passwd',$data{'username'},$data{'domain'}); |
|
if ($blocked) { |
|
$msg = '<p class="LC_warning">'.$blocktext.'</p>'; |
|
return $msg; |
|
} elsif ($now - $data{'time'} < 7200) { |
if ($env{'form.action'} eq 'verify_and_change_pass') { |
if ($env{'form.action'} eq 'verify_and_change_pass') { |
unless (($env{'form.uname'} eq $data{'username'}) && ($env{'form.udom'} eq $data{'domain'}) && ($env{'form.email'} eq $data{'email'})) { |
unless (($env{'form.uname'} eq $data{'username'}) && ($env{'form.udom'} eq $data{'domain'}) && ($env{'form.email'} eq $data{'email'})) { |
$msg = &generic_failure_msg($contact_name,$contact_email); |
$msg = &generic_failure_msg($contact_name,$contact_email); |
Line 395 sub generic_failure_msg {
|
Line 407 sub generic_failure_msg {
|
'<p class="LC_error">' |
'<p class="LC_error">' |
.&mt('A problem occurred when attempting to reset the password for your account.') |
.&mt('A problem occurred when attempting to reset the password for your account.') |
.'<br />' |
.'<br />' |
.&mt('Please contact the [_1] - ([_2]) for assistance.', |
.&mt('Please contact the [_1] ([_2]) for assistance.', |
$contact_name,'<a href="mailto:'.$contact_email.'">'.$contact_email.'</a>') |
$contact_name,'<a href="mailto:'.$contact_email.'">'.$contact_email.'</a>') |
.'</p>'; |
.'</p>'; |
} |
} |