Diff for /loncom/Lond.pm between versions 1.7 and 1.8.2.1

version 1.7, 2015/05/21 23:40:17 version 1.8.2.1, 2018/09/02 01:58:30
Line 409  sub dump_course_id_handler { Line 409  sub dump_course_id_handler {
     unless ($hasuniquecode) {      unless ($hasuniquecode) {
         $hasuniquecode = '.';          $hasuniquecode = '.';
     }      }
       if ($reqinstcode ne '') {
           $reqinstcode = &unescape($reqinstcode);
       }
     my $unpack = 1;      my $unpack = 1;
     if ($description eq '.' && $instcodefilter eq '.' && $ownerfilter eq '.' &&       if ($description eq '.' && $instcodefilter eq '.' && $ownerfilter eq '.' && 
         $typefilter eq '.') {          $typefilter eq '.') {
Line 779  sub dump_profile_database { Line 782  sub dump_profile_database {
     return $qresult;      return $qresult;
 }  }
   
   sub is_course {
       my ($cdom,$cnum) = @_;
   
       return unless (($cdom =~ /^$LONCAPA::match_domain$/) &&
                      ($cnum =~ /^$LONCAPA::match_courseid$/));
       my $hashid = $cdom.':'.$cnum;
       my ($iscourse,$cached) =
           &Apache::lonnet::is_cached_new('iscourse',$hashid);
       unless (defined($cached)) {
           my $hashref =
               &tie_domain_hash($cdom, "nohist_courseids", &GDBM_WRCREAT());
           if (ref($hashref) eq 'HASH') {
               my $esc_key = &escape($cdom.'_'.$cnum);
               if (exists($hashref->{$esc_key})) {
                   $iscourse = 1;
               } else {
                   $iscourse = 0;
               }
               &Apache::lonnet::do_cache_new('iscourse',$hashid,$iscourse,3600);
               unless (&untie_domain_hash($hashref)) {
                   &logthis("Failed to untie tied hash for nohist_courseids.db for $cdom");
               }
           } else {
               &logthis("Failed to tie hash for nohist_courseids.db for $cdom");
           }
       }
       return $iscourse;
   }
   
 1;  1;
   

Removed from v.1.7  
changed lines
  Added in v.1.8.2.1


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