Diff for /loncom/interface/resetpw.pm between versions 1.17.10.3 and 1.20

version 1.17.10.3, 2009/11/19 16:08:25 version 1.20, 2009/10/08 19:54:37
Line 26 Line 26
 # http://www.lon-capa.org/  # http://www.lon-capa.org/
 #  #
 #  #
   
 =pod  
   
 =head1 NAME  
   
 Apache::resetpw: reset user password.  
   
 =head1 SYNOPSIS  
   
 Handles resetting of forgotten passwords.  
   
 This is part of the LearningOnline Network with CAPA project  
 described at http://www.lon-capa.org.  
   
 =head1 OVERVIEW  
   
 A user with an e-mail address associated with his/her LON-CAPA username  
 can reset a forgotten password, using a link sent to the e-mail address  
 if the authentication type for the account is "internal".  
   
 =cut  
   
 package Apache::resetpw;  package Apache::resetpw;
   
 use strict;  use strict;
Line 109  sub handler { Line 87  sub handler {
                     }                      }
                     foreach my $item (@items) {                      foreach my $item (@items) {
                         if ($item =~ /^[^\@]+\@[^\@]+\.[^\@\.]+$/) {                          if ($item =~ /^[^\@]+\@[^\@]+\.[^\@\.]+$/) {
                             unless(grep(/^\Q$item\E$/,@allemails)) {                              unless(grep(/^\Q$item\E$/,@allemails)) { 
                                 push(@allemails,$item);                                  push(@allemails,$item);
                             }                              }
                         }                          }
Line 148  sub handler { Line 126  sub handler {
 sub get_uname {  sub get_uname {
     my ($defdom) = @_;      my ($defdom) = @_;
     my %lt = &Apache::lonlocal::texthash(      my %lt = &Apache::lonlocal::texthash(
                                          unam => 'LON-CAPA username',                                           unam => 'username',
                                          udom => 'LON-CAPA domain',                                           udom => 'domain',
                                          uemail => 'E-mail address in LON-CAPA',                                           uemail => 'E-mail address in LON-CAPA',
                                          proc => 'Proceed');                                           proc => 'Proceed');
   
Line 163  sub get_uname { Line 141  sub get_uname {
 <form name="forgotpw" method="post">  <form name="forgotpw" method="post">
 <table>  <table>
 <tr><td>  <tr><td>
 <tr><td align="left">$lt{'unam'}:</td>  <tr><td align="left">LON-CAPA $lt{'unam'}:                      </td>
     <td><input type="text" name="uname" size="15" /></td></tr>      <td><input type="text" name="uname" size="15" /></td></tr>
 <tr><td align="left">$lt{'udom'}:</td>  <tr><td align="left">LON-CAPA $lt{'udom'}:                      </td>
     <td>|;      <td>|;
     $msg .= &Apache::loncommon::select_dom_form($defdom,'udom');      $msg .= &Apache::loncommon::select_dom_form($defdom,'udom');
     $msg .= qq|</td></tr>      $msg .= qq|</td></tr>
Line 276  sub reset_passwd { Line 254  sub reset_passwd {
         my $reqtime = &Apache::lonlocal::locallocaltime($data{'time'});          my $reqtime = &Apache::lonlocal::locallocaltime($data{'time'});
         if ($now - $data{'time'} < 7200) {          if ($now - $data{'time'} < 7200) {
             if ($env{'form.action'} eq 'verify_and_change_pass') {              if ($env{'form.action'} eq 'verify_and_change_pass') {
                 unless (($env{'form.uname'} eq $data{'username'}) && ($env{'form.udom'} eq $data{'domain'}) && ($env{'form.email'} eq $data{'email'})) {  
                     $msg = &generic_failure_msg($contact_name,$contact_email);  
                     return $msg;  
                 }  
                 my $change_failed =                   my $change_failed = 
     &Apache::lonpreferences::verify_and_change_password($r,'reset_by_email',$token);      &Apache::lonpreferences::verify_and_change_password($r,'reset_by_email',$token);
                 if (!$change_failed) {                  if (!$change_failed) {

Removed from v.1.17.10.3  
changed lines
  Added in v.1.20


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