Diff for /loncom/interface/resetpw.pm between versions 1.28 and 1.29

version 1.28, 2012/10/02 18:08:12 version 1.29, 2013/02/01 17:39:22
Line 206  sub get_uname { Line 206  sub get_uname {
 sub send_token {  sub send_token {
     my ($uname,$udom,$email,$server,$domdesc,$contact_name,      my ($uname,$udom,$email,$server,$domdesc,$contact_name,
         $contact_email) = @_;          $contact_email) = @_;
     my $msg = &mt('Thank you for your request to reset the password for your LON-CAPA account.').'<br /><br />';      my $msg =
           '<p class="LC_info">'
          .&mt('Thank you for your request to reset the password for your LON-CAPA account.')
          .'</p>';
   
     my $now = time;      my $now = time;
     my $temppasswd = &create_passwd();      my $temppasswd = &create_passwd();
Line 229  sub send_token { Line 232  sub send_token {
             $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 />The link included in the message will be valid for the next <b>two</b> hours.");
         } else {          } else {
             $msg .=              $msg .=
                 '<p class="LC_warning">'                  '<p class="LC_error">'
                .&mt("An error occurred when sending a message to the e-mail address"                 .&mt('An error occurred when sending a message to the e-mail address'
                    ." associated with your LON-CAPA account."                     .' associated with your LON-CAPA account.')
                    ." Please contact the [_1] ([_2]) for assistance."                 .'</p>'
                     ,$contact_name,$contact_email)                 .&display_actions($contact_email,$domdesc);
                .'</p>';  
         }          }
     } else {      } else {
         $msg .=          $msg .=
             '<p class="LC_warning">'              '<p class="LC_error">'
            .&mt("An error occurred creating a token required for the"             .&mt('An error occurred creating a token required for the'
                ." password reset process."                 .' password reset process.')
                ." Please contact the [_1] ([_2]) for assistance."             .'</p>'
                 ,$contact_name,$contact_email)             .&display_actions($contact_email,$domdesc);
            .'</p>';  
     }      }
     return $msg;      return $msg;
 }  }
Line 272  sub invalid_state { Line 274  sub invalid_state {
     my ($error,$domdesc,$contact_name,$contact_email) = @_;      my ($error,$domdesc,$contact_name,$contact_email) = @_;
     my $msg;      my $msg;
     if ($error eq 'invalid') {      if ($error eq 'invalid') {
         $msg = '<p class="LC_warning">'.&mt('The username you provided was not verified as a valid username in the LON-CAPA system for the [_1] domain.',$domdesc)          $msg =
               .'</p>'.&mt('Please [_1]go back[_2] and try again.','<a href="javascript:history.go(-1)"><u>','</u></a>');              '<p class="LC_warning">'
               .&mt('The username you provided was not verified as a valid username'
                   .' in the LON-CAPA system for the [_1] domain.','<i>'.$domdesc.'</i>')
                 .'</p>';
           $msg .= &display_actions($contact_email,$domdesc);
     } else {      } else {
         if ($error eq 'baduseremail') {          if ($error eq 'baduseremail') {
             $msg = &mt('The e-mail address you provided does not appear to be a valid address.');              $msg = &mt('The e-mail address you provided does not appear to be a valid address.');
Line 284  sub invalid_state { Line 290  sub invalid_state {
         } elsif ($error eq 'authentication') {          } elsif ($error eq 'authentication') {
             $msg = &mt('The username you provided uses an authentication type which can not be reset directly via LON-CAPA.');              $msg = &mt('The username you provided uses an authentication type which can not be reset directly via LON-CAPA.');
         }          }
         $msg = '<p class="LC_warning">'.$msg.'</p>';          $msg = '<p class="LC_warning">'.$msg.'</p>'
         if ($contact_email ne '') {                .&display_actions($contact_email,$domdesc);
             my $escuri = &HTML::Entities::encode('/adm/resetpw','&<>"');  
             $msg .= '<br /> '.&mt('You may wish to contact the [_1]LON-CAPA helpdesk[_2] for the [_3] domain.'  
                                  ,'<a href="/adm/helpdesk?origurl='.$escuri.'">','</a>',$domdesc);  
         } else {  
             $msg .= '<br /> '.&mt('You may wish to send an e-mail to the server administrator: [_1] for the [_2] domain.',$Apache::lonnet::perlvar{'AdminEmail'},$domdesc);  
         }  
     }      }
     return $msg;      return $msg;
 }  }
Line 395  sub reset_passwd { Line 395  sub reset_passwd {
 sub generic_failure_msg {  sub generic_failure_msg {
     my ($contact_name,$contact_email) = @_;      my ($contact_name,$contact_email) = @_;
     return      return
         '<p class="LC_warning">'          '<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.')
            .' Please contact the [_1] - ([_2]) for assistance.',         .'<br />'
          .&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>';
 }  }
Line 422  sub create_passwd { Line 423  sub create_passwd {
     return ($passwd);      return ($passwd);
 }  }
   
   sub display_actions {
       my ($contact_email, $domdesc) = @_;
       my @msg = (&mt('[_1]Go back[_2] and try again',
                      '<a href="javascript:history.go(-1)">','</a>'));
       my $msg2 = '';
       if ($contact_email ne '') {
               my $escuri = &HTML::Entities::encode('/adm/resetpw','&<>"');
               push(@msg, &mt('Contact the [_1]LON-CAPA helpdesk[_2] for the institution: [_3]',
                              '<a href="/adm/helpdesk?origurl='.$escuri.'">',
                              '</a>','<i>'.$domdesc.'</i>'));
           } else {
               $msg2 =
                   '<p>'
                   .&mt('You may wish to send an e-mail to the'
                       .' server administrator: [_1] for the [_2] domain.',
                            '<i>'.$Apache::lonnet::perlvar{'AdminEmail'}.'</i>',
                            '<i>'.$domdesc.'</i>')
                   .'</p>';
           }
   
       return &Apache::lonhtmlcommon::actionbox(\@msg).$msg2;
   
   }
   
 1;  1;

Removed from v.1.28  
changed lines
  Added in v.1.29


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>