Diff for /loncom/interface/lonpreferences.pm between versions 1.74 and 1.75

version 1.74, 2006/01/06 21:04:34 version 1.75, 2006/03/15 21:19:10
Line 659  sub passwordchanger { Line 659  sub passwordchanger {
     $lkey_npass2= hex($lkey_npass2);      $lkey_npass2= hex($lkey_npass2);
     # Output javascript to deal with passwords      # Output javascript to deal with passwords
     # Output DES javascript      # Output DES javascript
     my $html=&Apache::lonxml::xmlbegin();  
     $r->print($html."<head>");  
     {      {
  my $include = $r->dir_config('lonIncludes');   my $include = $r->dir_config('lonIncludes');
  my $jsh=Apache::File->new($include."/londes.js");   my $jsh=Apache::File->new($include."/londes.js");
Line 741  sub verify_and_change_password { Line 739  sub verify_and_change_password {
     # Check for authentication types that allow changing of the password.      # Check for authentication types that allow changing of the password.
     return if ($currentauth !~ /^(unix|internal):/);      return if ($currentauth !~ /^(unix|internal):/);
     #      #
     my $html=&Apache::lonxml::xmlbegin();  
     $r->print(<<ENDHEADER);  
 $html  
 <head>  
 <title>LON-CAPA Preferences:  Change password for $user</title>  
 </head>  
 ENDHEADER  
     #  
     my $currentpass = $env{'form.currentpass'};       my $currentpass = $env{'form.currentpass'}; 
     my $newpass1    = $env{'form.newpass_1'};       my $newpass1    = $env{'form.newpass_1'}; 
     my $newpass2    = $env{'form.newpass_2'};      my $newpass2    = $env{'form.newpass_2'};
Line 773  password decryption.  Please log out and Line 763  password decryption.  Please log out and
 </p>  </p>
 ENDERROR  ENDERROR
         # Probably should log an error here          # Probably should log an error here
         return;          return 1;
     }      }
     my ($ckey,$n1key,$n2key)=split(/&/,$tmpinfo);      my ($ckey,$n1key,$n2key)=split(/&/,$tmpinfo);
     #       # 
Line 786  ENDERROR Line 776  ENDERROR
  '<font color="#ff0000">ERROR:</font>'.   '<font color="#ff0000">ERROR:</font>'.
  'The new passwords you entered do not match.  '.   'The new passwords you entered do not match.  '.
  'Please try again.');   'Please try again.');
  return;   return 1;
     }      }
     if (length($newpass1) < 7) {      if (length($newpass1) < 7) {
  &passwordchanger($r,   &passwordchanger($r,
  '<font color="#ff0000">ERROR:</font>'.   '<font color="#ff0000">ERROR:</font>'.
  'Passwords must be a minimum of 7 characters long.  '.   'Passwords must be a minimum of 7 characters long.  '.
  'Please try again.');   'Please try again.');
  return;   return 1;
     }      }
     #      #
     # Check for bad characters      # Check for bad characters
Line 828  ENDTEXT Line 818  ENDTEXT
 <h2><font color="#ff0000">The password for $user was not changed</font></h2>  <h2><font color="#ff0000">The password for $user was not changed</font></h2>
 Please make sure your old password was entered correctly.  Please make sure your old password was entered correctly.
 ENDERROR  ENDERROR
           return 1;
     }      }
     return;      return;
 }  }
Line 1096  sub handler { Line 1087  sub handler {
                           breadcrumb =>                             breadcrumb => 
                               { href =>'/adm/preferences?action=changepass',                                { href =>'/adm/preferences?action=changepass',
                                 text => 'Change Password'},                                  text => 'Change Password'},
                           printmenu => 'yes',                            printmenu => 'not_on_error',
                           }));                            }));
     }      }
     push (@Options,({ action   => 'changescreenname',      push (@Options,({ action   => 'changescreenname',
Line 1282  ENDHEADER Line 1273  ENDHEADER
     $r->print(&Apache::loncommon::bodytag('Change Preferences'));      $r->print(&Apache::loncommon::bodytag('Change Preferences'));
     $r->print(&Apache::lonhtmlcommon::breadcrumbs      $r->print(&Apache::lonhtmlcommon::breadcrumbs
               (undef,'Change Preferences',$help));                (undef,'Change Preferences',$help));
       my $error;
     if (defined($call)) {      if (defined($call)) {
         $call->($r);          $error = $call->($r);
     }      }
     if (($printmenu eq 'yes') && (!$env{'form.returnurl'})) {      if ( ( ($printmenu eq 'yes')
      || ($printmenu eq 'not_on_error' && !$error) )
    && (!$env{'form.returnurl'})) {
         my $optionlist = '<table cellpadding="5">';          my $optionlist = '<table cellpadding="5">';
         if ($env{'user.name'} =~           if ($env{'user.name'} =~ 
                          /^(albertel|kortemey|fox|foxr|korte|hallmat3|turtle|raeburn)$/                           /^(albertel|kortemey|fox|foxr|korte|hallmat3|turtle|raeburn)$/

Removed from v.1.74  
changed lines
  Added in v.1.75


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