version 1.13, 2009/02/12 21:15:47
|
version 1.15, 2009/02/23 20:28:21
|
Line 1
|
Line 1
|
# The LearningOnline Network |
# The LearningOnline Network |
# Allow access to password changing via a token sent to user's e-mail. |
# Allow access to password changing via a token sent to user's e-mail. |
# |
# |
|
# $Id$ |
|
# |
# Copyright Michigan State University Board of Trustees |
# Copyright Michigan State University Board of Trustees |
# |
# |
# This file is part of the LearningOnline Network with CAPA (LON-CAPA). |
# This file is part of the LearningOnline Network with CAPA (LON-CAPA). |
Line 140 sub get_uname {
|
Line 142 sub get_uname {
|
<tr><td align="left">$lt{'uemail'}: </td> |
<tr><td align="left">$lt{'uemail'}: </td> |
<td><input type="text" name="useremail" size="30" /></td></tr> |
<td><input type="text" name="useremail" size="30" /></td></tr> |
<tr><td colspan="2" align="left"><br /> |
<tr><td colspan="2" align="left"><br /> |
<input type="button" value="$lt{'proc'}" onClick="document.forgotpw.submit()"></td></tr> |
<input type="submit" value="$lt{'proc'}"></td></tr> |
</table> |
</table> |
</form> |
</form> |
|; |
|; |
Line 164 sub send_token {
|
Line 166 sub send_token {
|
my $token = &Apache::lonnet::tmpput(\%info,$server,'resetpw'); |
my $token = &Apache::lonnet::tmpput(\%info,$server,'resetpw'); |
if ($token !~ /^error/ && $token ne 'no_such_host') { |
if ($token !~ /^error/ && $token ne 'no_such_host') { |
my $esc_token = &escape($token); |
my $esc_token = &escape($token); |
my $mailmsg = "A request was submitted on ".&Apache::lonlocal::locallocaltime(time)." for a reset of the ". |
my $showtime = &Apache::lonlocal::locallocaltime(time); |
"password for your LON-CAPA account.". |
my $reseturl = &Apache::lonnet::absolute_url().'/adm/resetpw?token='.$esc_token; |
"To complete this process please open a web browser and enter the following ". |
my $mailmsg = &mt('A request was submitted on [_1] for reset of the password for your LON-CAPA account.',$showtime).' '.&mt('To complete this process please open a web browser and enter the following URL in the address/location box: [_1]',$reseturl); |
"URL in the address/location box: ".&Apache::lonnet::absolute_url()."/adm/resetpw?token=$esc_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') { |