--- loncom/interface/lonpreferences.pm 2019/04/24 01:44:30 1.228 +++ loncom/interface/lonpreferences.pm 2019/04/24 02:00:23 1.229 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.228 2019/04/24 01:44:30 raeburn Exp $ +# $Id: lonpreferences.pm,v 1.229 2019/04/24 02:00:23 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1288,42 +1288,42 @@ sub passwordchanger { $caller = 'preferences'; } } elsif ($caller eq 'reset_by_email') { - my %data = &Apache::lonnet::tmpget($mailtoken); - if (keys(%data) == 0) { - $r->print( - '

' - .&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.' - ,'','') - .'

' - ); - return; - } - if (defined($data{time})) { - if (time - $data{'time'} < $timelimit) { - $user = $data{'username'}; - $domain = $data{'domain'}; - $currentpass = $data{'temppasswd'}; - } else { - $r->print( - '

' - .&mt('Sorry, the token generated when you requested' - .' a password reset has expired.') - .'

' - ); - return; - } + my %data = &Apache::lonnet::tmpget($mailtoken); + if (keys(%data) == 0) { + $r->print( + '

' + .&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.' + ,'','') + .'

' + ); + return; + } + if (defined($data{time})) { + if (time - $data{'time'} < $timelimit) { + $user = $data{'username'}; + $domain = $data{'domain'}; + $currentpass = $data{'temppasswd'}; } else { $r->print( '

' - .&mt('Sorry, the URL generated when you requested reset of' - .' your password contained incomplete information.') + .&mt('Sorry, the token generated when you requested' + .' a password reset has expired.') .'

' ); return; } - if (&Apache::lonnet::domain($domain) eq '') { - $domain = $r->dir_config('lonDefDomain'); - } + } else { + $r->print( + '

' + .&mt('Sorry, the URL generated when you requested reset of' + .' your password contained incomplete information.') + .'

' + ); + return; + } + if (&Apache::lonnet::domain($domain) eq '') { + $domain = $r->dir_config('lonDefDomain'); + } } else { $r->print( '

'