Diff for /loncom/interface/lonpreferences.pm between versions 1.196.4.27 and 1.196.4.29

version 1.196.4.27, 2021/03/06 19:44:54 version 1.196.4.29, 2024/07/04 23:13:07
Line 1230  sub passwordchanger { Line 1230  sub passwordchanger {
     # This function is a bit of a mess....      # This function is a bit of a mess....
     # Passwords are encrypted using londes.js (DES encryption)      # Passwords are encrypted using londes.js (DES encryption)
     $errormessage = ($errormessage || '');      $errormessage = ($errormessage || '');
     my ($user,$domain,$currentpass);      my ($user,$domain,$currentpass,$clientip);
       $clientip = &Apache::lonnet::get_requestor_ip($r);
     &Apache::lonhtmlcommon::add_breadcrumb(      &Apache::lonhtmlcommon::add_breadcrumb(
  { href => '/adm/preferences?action=changepass',   { href => '/adm/preferences?action=changepass',
                   text => 'Change Password'});                    text => 'Change Password'});
Line 1245  sub passwordchanger { Line 1246  sub passwordchanger {
             $caller = 'preferences';              $caller = 'preferences';
         }          }
         my ($blocked,$blocktext) =          my ($blocked,$blocktext) =
             &Apache::loncommon::blocking_status('passwd');              &Apache::loncommon::blocking_status('passwd',$clientip);
         if ($blocked) {          if ($blocked) {
             $r->print('<p class="LC_warning">'.$blocktext.'</p>');              $r->print('<p class="LC_warning">'.$blocktext.'</p>');
             return;              return;
Line 1267  sub passwordchanger { Line 1268  sub passwordchanger {
                 $domain = $data{'domain'};                  $domain = $data{'domain'};
                 $currentpass = $data{'temppasswd'};                  $currentpass = $data{'temppasswd'};
                 my ($blocked,$blocktext) =                  my ($blocked,$blocktext) =
                     &Apache::loncommon::blocking_status('passwd',$user,$domain);                      &Apache::loncommon::blocking_status('passwd',$clientip,$user,$domain);
                 if ($blocked) {                  if ($blocked) {
                     $r->print('<p class="LC_warning">'.$blocktext.'</p>');                      $r->print('<p class="LC_warning">'.$blocktext.'</p>');
                     return;                      return;
Line 1588  sub server_form { Line 1589  sub server_form {
   
 sub verify_and_change_password {  sub verify_and_change_password {
     my ($r,$caller,$mailtoken,$timelimit,$extrafields,$ended) = @_;      my ($r,$caller,$mailtoken,$timelimit,$extrafields,$ended) = @_;
     my ($user,$domain,$homeserver);      my ($user,$domain,$homeserver,$clientip);
     if ($caller eq 'reset_by_email') {      if ($caller eq 'reset_by_email') {
         $user       = $env{'form.uname'};          $user       = $env{'form.uname'};
         $domain     = $env{'form.udom'};          $domain     = $env{'form.udom'};
Line 1611  sub verify_and_change_password { Line 1612  sub verify_and_change_password {
         $domain     = $env{'user.domain'};          $domain     = $env{'user.domain'};
         $homeserver = $env{'user.home'};          $homeserver = $env{'user.home'};
     }      }
       $clientip = &Apache::lonnet::get_requestor_ip($r);
     my ($blocked,$blocktext) =      my ($blocked,$blocktext) =
         &Apache::loncommon::blocking_status('passwd',$user,$domain);          &Apache::loncommon::blocking_status('passwd',$clientip,$user,$domain);
     if ($blocked) {      if ($blocked) {
         $r->print('<p class="LC_warning">'.$blocktext.'</p>');          $r->print('<p class="LC_warning">'.$blocktext.'</p>');
         if ($caller eq 'reset_by_email') {          if ($caller eq 'reset_by_email') {
Line 2092  sub change_authoring_settings { Line 2094  sub change_authoring_settings {
   
 sub lockednameschanger {  sub lockednameschanger {
     my $r = shift;      my $r = shift;
     &Apache::lonhtmlcommon::add_breadcrumb(  
             {   href => '/adm/preferences?action=changelockednames',  
                 text => 'Automatic name changes'});  
     $r->print(Apache::loncommon::start_page('Automatic name changes'));  
     $r->print(Apache::lonhtmlcommon::breadcrumbs('Allow/disallow name updates'));  
     my %userenv = &Apache::lonnet::get('environment',['lockedname']);      my %userenv = &Apache::lonnet::get('environment',['lockedname']);
     my $lockedname='';      my $lockedname='';
       my $ended;
     if (&can_toggle_namelocking()) {      if (&can_toggle_namelocking()) {
         if ($userenv{'lockedname'}) {          if ($userenv{'lockedname'}) {
             $lockedname = ' checked="checked"';              $lockedname = ' checked="checked"';
Line 2116  sub lockednameschanger { Line 2114  sub lockednameschanger {
             }              }
         }          }
         if (keys(%updateable)) {          if (keys(%updateable)) {
               &Apache::lonhtmlcommon::add_breadcrumb(
                   {   href => '/adm/preferences?action=changelockednames',
                       text => 'Automatic name changes'});
               $r->print(Apache::loncommon::start_page('Automatic name changes'));
               $r->print(Apache::lonhtmlcommon::breadcrumbs('Allow/disallow name updates'));
             my %longnames = &Apache::lonlocal::texthash (              my %longnames = &Apache::lonlocal::texthash (
                                 firstname  => 'First Name',                                  firstname  => 'First Name',
                                 middlename => 'Middle Name',                                  middlename => 'Middle Name',
Line 2142  ENDSCREEN Line 2145  ENDSCREEN
         } else {          } else {
             my $message = &mt('Based on your institutional affiliation no name information is automatically updated for your LON-CAPA account.');              my $message = &mt('Based on your institutional affiliation no name information is automatically updated for your LON-CAPA account.');
             &print_main_menu($r,$message);              &print_main_menu($r,$message);
               $ended = 1;
         }          }
     } else {      } else {
         my $message = &mt('You are not permitted to set a user preference for automatic name updates for your LON-CAPA account.');          my $message = &mt('You are not permitted to set a user preference for automatic name updates for your LON-CAPA account.');
         &print_main_menu($r,$message);          &print_main_menu($r,$message);
           $ended = 1;
     }      }
       return $ended;
 }  }
   
 sub verify_and_change_lockednames {  sub verify_and_change_lockednames {
Line 2506  sub handler { Line 2512  sub handler {
  &print_main_menu($r);   &print_main_menu($r);
         $ended = 1;          $ended = 1;
     } elsif ($env{'form.action'} eq 'changelockednames') {      } elsif ($env{'form.action'} eq 'changelockednames') {
         &lockednameschanger($r);          $ended = &lockednameschanger($r);
     } elsif ($env{'form.action'} eq 'verify_and_change_lockednames') {      } elsif ($env{'form.action'} eq 'verify_and_change_lockednames') {
         &verify_and_change_lockednames($r);          &verify_and_change_lockednames($r);
         $ended = 1;          $ended = 1;

Removed from v.1.196.4.27  
changed lines
  Added in v.1.196.4.29


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