--- loncom/interface/resetpw.pm 2013/03/25 16:33:08 1.32 +++ loncom/interface/resetpw.pm 2013/07/19 16:17:07 1.33 @@ -1,7 +1,7 @@ # The LearningOnline Network # Allow access to password changing via a token sent to user's e-mail. # -# $Id: resetpw.pm,v 1.32 2013/03/25 16:33:08 bisitz Exp $ +# $Id: resetpw.pm,v 1.33 2013/07/19 16:17:07 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -91,13 +91,10 @@ sub handler { my $udom = $env{'form.udom'}; my $token = $env{'form.token'}; my $brcrum = []; - my $bread_crumbs_component = 'Forgotten Password'; if ($token) { push (@{$brcrum}, {href => '/adm/resetpw', text => 'Update Password'}); - - $bread_crumbs_component = 'Reset Password'; } else { push (@{$brcrum}, {href => '/adm/resetpw', @@ -108,10 +105,9 @@ sub handler { text => 'Result'}); } } - my $args = {bread_crumbs => $brcrum, - bread_crumbs_component => $bread_crumbs_component}; + my $args = {bread_crumbs => $brcrum}; $r->print(&Apache::loncommon::start_page('Reset password','',$args)); - $r->print('

'.&mt('Reset forgotten LON-CAPA password').'

'); + $r->print('

'.&mt('Reset forgotten LON-CAPA password').'

'); my $output; if ($token) { $output = &reset_passwd($r,$token,$contact_name,$contact_email); @@ -328,23 +324,24 @@ sub reset_passwd { my $mailmsg = &mt('The password for your LON-CAPA account in the [_1] domain was changed [_2] from IP address: [_3]. If you did not perform this change or authorize it, please contact the [_4] ([_5]).',$domdesc,$now,$ENV{'REMOTE_ADDR'},$contact_name,$contact_email)."\n"; my $result = &send_mail($domdesc,$data{'email'},$mailmsg, $contact_name,$contact_email); + my $confirm_msg; if ($result eq 'ok') { - $msg .= - '

' - .&mt('An e-mail confirming setting of the password' - .' for your LON-CAPA account has been sent to [_1].' - ,$data{'email'}) - .'

'; + $confirm_msg = + &Apache::lonhtmlcommon::confirm_success( + &mt('An e-mail confirming setting of the password' + .' for your LON-CAPA account has been sent to [_1].' + ,''.$data{'email'}.'')); } else { - $msg .= - '

' - .&mt('An error occurred when sending e-mail to [_1]' - .' confirming setting of your new password.' - ,$data{'email'}) - .'

'; + $confirm_msg = + &Apache::lonhtmlcommon::confirm_success( + &mt('An error occurred when sending e-mail to [_1]' + .' confirming setting of your new password.' + ,''.$data{'email'}.''),1); } - $msg .= '
' - .''.&mt('Go to the login page').'.'; + $msg .= + &Apache::loncommon::confirmwrapper($confirm_msg) + .&Apache::lonhtmlcommon::actionbox([ + ''.&mt('Go to the login page').'']); } elsif ($change_failed eq 'invalid_client') { my $homeserver = &Apache::lonnet::homeserver($data{'username'},$data{'domain'}); if ($homeserver eq 'no_host') {