Diff for /loncom/interface/domainprefs.pm between versions 1.374 and 1.377

version 1.374, 2020/12/23 21:39:23 version 1.377, 2021/01/30 21:47:44
Line 7203  sub print_wafproxy { Line 7203  sub print_wafproxy {
                     if (ref($settings->{'alias'}) eq 'HASH') {                      if (ref($settings->{'alias'}) eq 'HASH') {
                         $aliases{$dom} = $settings->{'alias'};                          $aliases{$dom} = $settings->{'alias'};
                     }                      }
                     foreach my $item ('ipheader','trusted','exempt') {                      foreach my $item ('ipheader','trusted','vpnint','vpnext') {
                         $values{$dom}{$item} = $settings->{$item};                          $values{$dom}{$item} = $settings->{$item};
                     }                      }
                 }                  }
Line 7218  sub print_wafproxy { Line 7218  sub print_wafproxy {
             if (ref($config{$domain}) eq 'HASH') {              if (ref($config{$domain}) eq 'HASH') {
                 if (ref($config{$domain}{'wafproxy'}) eq 'HASH') {                  if (ref($config{$domain}{'wafproxy'}) eq 'HASH') {
                     $aliases{$domain} = $config{$domain}{'wafproxy'}{'alias'};                      $aliases{$domain} = $config{$domain}{'wafproxy'}{'alias'};
                     foreach my $item ('ipheader','trusted','exempt') {                      foreach my $item ('ipheader','trusted','vpnint','vpnext') {
                         $values{$domain}{$item} = $config{$domain}{'wafproxy'}{$item};                          $values{$domain}{$item} = $config{$domain}{'wafproxy'}{$item};
                     }                      }
                 }                  }
Line 7268  sub print_wafproxy { Line 7268  sub print_wafproxy {
                           &mt('Format for comma separated IP blocks').':<br />'.                            &mt('Format for comma separated IP blocks').':<br />'.
                           &mt('A.B.C.D/N or A.B.C.D - E.F.G.H').'</td>'.                            &mt('A.B.C.D/N or A.B.C.D - E.F.G.H').'</td>'.
                           '<td class="LC_left_item"><table>';                            '<td class="LC_left_item"><table>';
             foreach my $item ('ipheader','trusted','exempt') {              foreach my $item ('ipheader','trusted','vpnint','vpnext') {
                 $datatable .= '<tr>'.                  $datatable .= '<tr>'.
                               '<td valign="top">'.$lt{$item}.':&nbsp;';                                '<td valign="top">'.$lt{$item}.':&nbsp;';
                 if ($item eq 'ipheader') {                  if ($item eq 'ipheader') {
Line 7290  sub print_wafproxy { Line 7290  sub print_wafproxy {
                 $datatable .= '<tr'.$css_class.'>'.                  $datatable .= '<tr'.$css_class.'>'.
                               '<td class="LC_left_item">'.&mt('Domain: [_1]',$domain).'</td>'.                                '<td class="LC_left_item">'.&mt('Domain: [_1]',$domain).'</td>'.
                               '<td class="LC_left_item"><table>';                                '<td class="LC_left_item"><table>';
                 foreach my $item ('ipheader','trusted','exempt') {                  foreach my $item ('ipheader','trusted','vpnint','vpnext') {
                     my $showval = &mt('None');                      my $showval = &mt('None');
                     if ($values{$domain}{$item}) {                      if ($values{$domain}{$item}) {
                         $showval = $values{$domain}{$item};                           $showval = $values{$domain}{$item}; 
Line 7308  sub print_wafproxy { Line 7308  sub print_wafproxy {
   
 sub wafproxy_titles {  sub wafproxy_titles {
     return &Apache::lonlocal::texthash(      return &Apache::lonlocal::texthash(
                exempt => 'Exempt IP range(s)',                 vpnint => 'Internal IP Range(s) for VPN sessions',
                  vpnext => 'IP Range for backend WAF connections',
                trusted => 'Trusted IP range(s)',                 trusted => 'Trusted IP range(s)',
                ipheader => 'Custom request header',                 ipheader => 'Custom request header',
            );             );
Line 15204  sub modify_contacts { Line 15205  sub modify_contacts {
                 $contacts_hash{'contacts'}{'lonstatus'}{$item} = \@excluded;                  $contacts_hash{'contacts'}{'lonstatus'}{$item} = \@excluded;
             }              }
         } elsif ($item eq 'weights') {          } elsif ($item eq 'weights') {
             foreach my $type ('E','W','N') {              foreach my $type ('E','W','N','U') {
                 $env{'form.error'.$item.'_'.$type} =~ s/^\s+|\s+$//g;                  $env{'form.error'.$item.'_'.$type} =~ s/^\s+|\s+$//g;
                 if ($env{'form.error'.$item.'_'.$type} =~ /^\d+$/) {                  if ($env{'form.error'.$item.'_'.$type} =~ /^\d+$/) {
                     unless ($env{'form.error'.$item.'_'.$type} == $lonstatus_defs->{$type}) {                      unless ($env{'form.error'.$item.'_'.$type} == $lonstatus_defs->{$type}) {
Line 20721  sub modify_loadbalancing { Line 20722  sub modify_loadbalancing {
                             $resulttext .= '<li>'.&mt('Load Balancer: [_1] -- cookie use enabled',                              $resulttext .= '<li>'.&mt('Load Balancer: [_1] -- cookie use enabled',
                                                       $balancer).'</li>';                                                         $balancer).'</li>'; 
                         }                          }
                         if (keys(%toupdate)) {                      }
                             my %thismachine;                  }
                             my $updatedhere;                  if (keys(%toupdate)) {
                             my $cachetime = 60*60*24;                      my %thismachine;
                             map { $thismachine{$_} = 1; } &Apache::lonnet::current_machine_ids();                      my $updatedhere;
                             foreach my $lonhost (keys(%toupdate)) {                      my $cachetime = 60*60*24;
                                 if ($thismachine{$lonhost}) {                      map { $thismachine{$_} = 1; } &Apache::lonnet::current_machine_ids();
                                     unless ($updatedhere) {                      foreach my $lonhost (keys(%toupdate)) {
                                         &Apache::lonnet::do_cache_new('loadbalancing',$dom,                          if ($thismachine{$lonhost}) {
                                                                       $defaultshash{'loadbalancing'},                              unless ($updatedhere) {
                                                                       $cachetime);                                  &Apache::lonnet::do_cache_new('loadbalancing',$dom,
                                         $updatedhere = 1;                                                                $defaultshash{'loadbalancing'},
                                     }                                                                $cachetime);
                                 } else {                                  $updatedhere = 1;
                                     my $cachekey = &escape('loadbalancing').':'.&escape($dom);  
                                     &Apache::lonnet::remote_devalidate_cache($lonhost,[$cachekey]);  
                                 }  
                             }                              }
                           } else {
                               my $cachekey = &escape('loadbalancing').':'.&escape($dom);
                               &Apache::lonnet::remote_devalidate_cache($lonhost,[$cachekey]);
                         }                          }
                     }                      }
                 }                  }

Removed from v.1.374  
changed lines
  Added in v.1.377


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