Diff for /loncom/lonnet/perl/lonnet.pm between versions 1.1496 and 1.1500

version 1.1496, 2022/10/19 00:03:11 version 1.1500, 2022/10/29 18:13:29
Line 12468  sub count_supptools { Line 12468  sub count_supptools {
         my $chome=&homeserver($cnum,$cdom);          my $chome=&homeserver($cnum,$cdom);
         $numexttools = 0;          $numexttools = 0;
         unless ($chome eq 'no_host') {          unless ($chome eq 'no_host') {
             my ($supplemental) = &get_supplemental($cnum,$cdom,$reload);              my ($supplemental) = &Apache::loncommon::get_supplemental($cnum,$cdom,$reload);
             if (ref($supplemental) eq 'HASH') {              if (ref($supplemental) eq 'HASH') {
                 if ((ref($supplemental->{'ids'}) eq 'HASH') && (ref($supplemental->{'hidden'}) eq 'HASH')) {                  if ((ref($supplemental->{'ids'}) eq 'HASH') && (ref($supplemental->{'hidden'}) eq 'HASH')) {
                     foreach my $key (keys(%{$supplemental->{'ids'}})) {                      foreach my $key (keys(%{$supplemental->{'ids'}})) {
Line 12485  sub count_supptools { Line 12485  sub count_supptools {
 }  }
   
 sub has_unhidden_suppfiles {  sub has_unhidden_suppfiles {
     my ($cnum,$cdom,$ignorecache)=@_;      my ($cnum,$cdom,$ignorecache,$possdel)=@_;
     my $hashid=$cnum.':'.$cdom;      my $hashid=$cnum.':'.$cdom;
     my ($showsupp,$cached);      my ($showsupp,$cached);
     unless ($ignorecache) {      unless ($ignorecache) {
Line 12494  sub has_unhidden_suppfiles { Line 12494  sub has_unhidden_suppfiles {
     unless (defined($cached)) {      unless (defined($cached)) {
         my $chome=&homeserver($cnum,$cdom);          my $chome=&homeserver($cnum,$cdom);
         unless ($chome eq 'no_host') {          unless ($chome eq 'no_host') {
             my ($supplemental) = &get_supplemental($cnum,$cdom,$ignorecache);              my ($supplemental) = &Apache::loncommon::get_supplemental($cnum,$cdom,$ignorecache,$possdel);
             if (ref($supplemental) eq 'HASH') {              if (ref($supplemental) eq 'HASH') {
                 if ((ref($supplemental->{'ids'}) eq 'HASH') && (ref($supplemental->{'hidden'}) eq 'HASH')) {                  if ((ref($supplemental->{'ids'}) eq 'HASH') && (ref($supplemental->{'hidden'}) eq 'HASH')) {
                     foreach my $key (keys(%{$supplemental->{'ids'}})) {                      foreach my $key (keys(%{$supplemental->{'ids'}})) {
Line 12517  sub has_unhidden_suppfiles { Line 12517  sub has_unhidden_suppfiles {
     return $showsupp;      return $showsupp;
 }  }
   
 sub get_supplemental {  
     my ($cnum,$cdom,$ignorecache,$possdel)=@_;  
     my $hashid=$cnum.':'.$cdom;  
     my ($supplemental,$cached,$set_httprefs);  
     unless ($ignorecache) {  
         ($supplemental,$cached) = &is_cached_new('supplemental',$hashid);  
     }  
     unless (defined($cached)) {  
         my $chome=&homeserver($cnum,$cdom);  
         unless ($chome eq 'no_host') {  
             my ($errors,%ids,%hidden);  
             $errors =  
                 &Apache::loncommon::recurse_supplemental($cnum,$cdom,  
                                                          'supplemental.sequence',  
                                                          $errors,$possdel,\%ids,\%hidden);  
             $set_httprefs = 1;  
             if ($env{'request.course.id'} eq $cdom.'_'.$cnum) {  
                 &Apache::lonnet::appenv({'request.course.suppupdated' => time});  
             }  
             $supplemental = {  
                                ids => \%ids,  
                                hidden => \%hidden,  
                             };  
             &do_cache_new('supplemental',$hashid,$supplemental,600);  
         }  
     }  
     return ($supplemental,$set_httprefs);  
 }  
   
 #  #
 # EXT resource caching routines  # EXT resource caching routines
 #  #
Line 13710  sub devalidate_suppchange_cache { Line 13681  sub devalidate_suppchange_cache {
     &devalidate_cache_new('suppchange',$hashid);      &devalidate_cache_new('suppchange',$hashid);
 }  }
   
   sub update_supp_caches {
       my ($cdom,$cnum) = @_;
       my %servers = &internet_dom_servers($cdom);
       my @ids=&current_machine_ids();
       foreach my $server (keys(%servers)) {
           next if (grep(/^\Q$server\E$/,@ids));
           my $hashid=$cnum.':'.$cdom;
           my $cachekey = &escape('showsupp').':'.&escape($hashid);
           &remote_devalidate_cache($server,[$cachekey]);
       }
       &has_unhidden_suppfiles($cnum,$cdom,1,1);
       &count_supptools($cnum,$cdom,1);
       my $now = time;
       if ($env{'request.course.id'} eq $cdom.'_'.$cnum) {
           &Apache::lonnet::appenv({'request.course.suppupdated' => $now});
       }
       &put('environment',{'internal.supplementalchange' => $now},
            $cdom,$cnum);
       &Apache::lonnet::appenv(
           {'course.'.$cdom.'_'.$cnum.'.internal.supplementalchange' => $now});
       &do_cache_new('suppchange',$cdom.'_'.$cnum,$now,600);
   }
   
 # ------------------------------------------------- Update symbolic store links  # ------------------------------------------------- Update symbolic store links
   
 sub symblist {  sub symblist {

Removed from v.1.1496  
changed lines
  Added in v.1.1500


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