Diff for /loncom/lonnet/perl/lonnet.pm between versions 1.977 and 1.978

version 1.977, 2008/12/09 11:32:03 version 1.978, 2008/12/18 16:58:31
Line 4406  sub is_portfolio_file { Line 4406  sub is_portfolio_file {
 }  }
   
 sub usertools_access {  sub usertools_access {
     my ($uname,$udom,$tool) = @_;      my ($uname,$udom,$tool,$action) = @_;
     my $access;      my $access;
     my %tools = (      my %tools = (
                   aboutme   => 1,                    aboutme   => 1,
Line 4420  sub usertools_access { Line 4420  sub usertools_access {
         $uname = $env{'user.name'};          $uname = $env{'user.name'};
     }      }
   
     my $hashid=$uname.':'.$udom;      if (($udom eq $env{'user.domain'}) && ($uname eq $env{'user.name'})) {
     my ($result,$cached) = &is_cached_new('usertools.'.$tool,$hashid);          if ($action ne 'reload') {
     if (defined($cached)) {              return $env{'environment.availabletools.'.$tool};
         return $result;          } 
     }      }
   
     my ($toolstatus,$inststatus);      my ($toolstatus,$inststatus);
Line 4443  sub usertools_access { Line 4443  sub usertools_access {
         } else {          } else {
             $access = 0;              $access = 0;
         }          }
         &do_cache_new('usertools.'.$tool,$hashid,$access,600);  
         return $access;          return $access;
     }      }
   
Line 4457  sub usertools_access { Line 4456  sub usertools_access {
                 } else {                  } else {
                     $access = 0;                      $access = 0;
                 }                  }
                 &do_cache_new('usertools.'.$tool,$hashid,$access,600);  
                 return $access;                  return $access;
             }              }
         }          }
Line 4478  sub usertools_access { Line 4476  sub usertools_access {
                 } elsif ($hasnoaccess) {                  } elsif ($hasnoaccess) {
                     $access = 0;                       $access = 0; 
                 }                  }
                 &do_cache_new('usertools.'.$tool,$hashid,$access,600);  
                 return $access;                  return $access;
             }              }
         } else {          } else {
Line 4488  sub usertools_access { Line 4485  sub usertools_access {
                 } elsif ($domdef{$tool}{'default'} == 0) {                  } elsif ($domdef{$tool}{'default'} == 0) {
                     $access = 0;                      $access = 0;
                 }                  }
                 &do_cache_new('usertools.'.$tool,$hashid,$access,600);  
                 return $access;                  return $access;
             }              }
         }          }
     } else {      } else {
         $access = 1;          $access = 1;
         &do_cache_new('usertools.'.$tool,$hashid,$access,600);  
         return $access;          return $access;
     }      }
 }  }

Removed from v.1.977  
changed lines
  Added in v.1.978


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