version 1.228, 2019/04/24 01:44:30
|
version 1.230, 2019/04/24 21:12:44
|
Line 27
|
Line 27
|
# |
# |
# This package uses the "londes.js" javascript code. |
# This package uses the "londes.js" javascript code. |
# |
# |
# TODOs that have to be completed: |
|
# interface with lonnet to change the password |
|
|
|
package Apache::lonpreferences; |
package Apache::lonpreferences; |
|
|
Line 1288 sub passwordchanger {
|
Line 1286 sub passwordchanger {
|
$caller = 'preferences'; |
$caller = 'preferences'; |
} |
} |
} elsif ($caller eq 'reset_by_email') { |
} elsif ($caller eq 'reset_by_email') { |
my %data = &Apache::lonnet::tmpget($mailtoken); |
my %data = &Apache::lonnet::tmpget($mailtoken); |
if (keys(%data) == 0) { |
if (keys(%data) == 0) { |
$r->print( |
$r->print( |
'<p class="LC_warning">' |
'<p class="LC_warning">' |
.&mt('Sorry, the URL you provided to complete the reset of your password was invalid. Either the token included in the URL has been deleted or the URL you provided was invalid. Please submit a [_1]new request[_2] for a password reset, and follow the link to the new URL included in the e-mail that will be sent to you, to allow you to enter a new password.' |
.&mt('Sorry, the URL you provided to complete the reset of your password was invalid. Either the token included in the URL has been deleted or the URL you provided was invalid. Please submit a [_1]new request[_2] for a password reset, and follow the link to the new URL included in the e-mail that will be sent to you, to allow you to enter a new password.' |
,'<a href="/adm/resetpw">','</a>') |
,'<a href="/adm/resetpw">','</a>') |
.'</p>' |
.'</p>' |
); |
); |
return; |
return; |
} |
} |
if (defined($data{time})) { |
if (defined($data{time})) { |
if (time - $data{'time'} < $timelimit) { |
if (time - $data{'time'} < $timelimit) { |
$user = $data{'username'}; |
$user = $data{'username'}; |
$domain = $data{'domain'}; |
$domain = $data{'domain'}; |
$currentpass = $data{'temppasswd'}; |
$currentpass = $data{'temppasswd'}; |
} else { |
|
$r->print( |
|
'<p class="LC_warning">' |
|
.&mt('Sorry, the token generated when you requested' |
|
.' a password reset has expired.') |
|
.'</p>' |
|
); |
|
return; |
|
} |
|
} else { |
} else { |
$r->print( |
$r->print( |
'<p class="LC_warning">' |
'<p class="LC_warning">' |
.&mt('Sorry, the URL generated when you requested reset of' |
.&mt('Sorry, the token generated when you requested' |
.' your password contained incomplete information.') |
.' a password reset has expired.') |
.'</p>' |
.'</p>' |
); |
); |
return; |
return; |
} |
} |
if (&Apache::lonnet::domain($domain) eq '') { |
} else { |
$domain = $r->dir_config('lonDefDomain'); |
$r->print( |
} |
'<p class="LC_warning">' |
|
.&mt('Sorry, the URL generated when you requested reset of' |
|
.' your password contained incomplete information.') |
|
.'</p>' |
|
); |
|
return; |
|
} |
|
if (&Apache::lonnet::domain($domain) eq '') { |
|
$domain = $r->dir_config('lonDefDomain'); |
|
} |
} else { |
} else { |
$r->print( |
$r->print( |
'<p class="LC_error">' |
'<p class="LC_error">' |