Diff for /loncom/lonnet/perl/lonnet.pm between versions 1.902 and 1.907

version 1.902, 2007/07/28 21:14:09 version 1.907, 2007/08/21 23:34:38
Line 862  sub inst_directory_query { Line 862  sub inst_directory_query {
     my %results;      my %results;
     my $homeserver = &domain($udom,'primary');      my $homeserver = &domain($udom,'primary');
     if ($homeserver ne '') {      if ($homeserver ne '') {
         my $response=&reply("instdirsrch:$udom".':'.   my $queryid=&reply("querysend:instdirsearch:".
                             &escape($srch->{'srchby'}).':'.     &escape($srch->{'srchby'}).':'.
                             &escape($srch->{'srchterm'}).':'.     &escape($srch->{'srchterm'}).':'.
                             $srch->{'srchtype'},$homeserver);     &escape($srch->{'srchtype'}),$homeserver);
         if ($response ne 'refused') {   my $host=&hostname($homeserver);
             my @matches = split(/&/,$response);   if ($queryid !~/^\Q$host\E\_/) {
       &logthis('instituional directory search invalid queryid: '.$queryid.' for host: '.$homeserver.'in domain '.$udom);
       return;
    }
    my $response = &get_query_reply($queryid);
    my $maxtries = 5;
    my $tries = 1;
    while (($response=~/^timeout/) && ($tries < $maxtries)) {
       $response = &get_query_reply($queryid);
       $tries ++;
    }
   
           if (!&error($response) && $response ne 'refused') {
               my @matches = split(/\n/,$response);
             foreach my $match (@matches) {              foreach my $match (@matches) {
                 my ($key,$value) = split(/=/,$match);                  my ($key,$value) = split(/=/,$match);
                 my %userhash = &str2hash(&unescape($value));                  $results{&unescape($key).':'.$udom} = &thaw_unescape($value);
                 $results{&unescape($key).':'.$udom} = \%userhash;  
             }              }
         }          }
     }      }
Line 2203  sub userrolelog { Line 2215  sub userrolelog {
          {$trole.':'.$username.':'.$domain.':'.$runame.':'.$rudom.':'.$rsec}           {$trole.':'.$username.':'.$domain.':'.$runame.':'.$rudom.':'.$rsec}
                     = $tend.':'.$tstart;                      = $tend.':'.$tstart;
     }      }
     &flushcourselogs();  
 }  }
   
 sub get_course_adv_roles {  sub get_course_adv_roles {
Line 4542  sub get_query_reply { Line 4553  sub get_query_reply {
  sleep 2;   sleep 2;
         if (-e $replyfile.'.end') {          if (-e $replyfile.'.end') {
     if (open(my $fh,$replyfile)) {      if (open(my $fh,$replyfile)) {
                $reply.=<$fh>;   $reply = join('',<$fh>);
                close($fh);   close($fh);
    } else { return 'error: reply_file_error'; }     } else { return 'error: reply_file_error'; }
            return &unescape($reply);             return &unescape($reply);
  }   }
Line 6306  sub EXT { Line 6317  sub EXT {
     my ($map) = &decode_symb($symbparm);      my ($map) = &decode_symb($symbparm);
     return &symbread($map);      return &symbread($map);
  }   }
    if ($space eq 'filename') {
       if ($symbparm) {
    return &clutter((&decode_symb($symbparm))[2]);
       }
       return &hreflocation('',$env{'request.filename'});
    }
   
  my ($section, $group, @groups);   my ($section, $group, @groups);
  my ($courselevelm,$courselevel);   my ($courselevelm,$courselevel);
Line 6822  sub gettitle { Line 6839  sub gettitle {
  }   }
  my ($map,$resid,$url)=&decode_symb($symb);   my ($map,$resid,$url)=&decode_symb($symb);
  my $title='';   my $title='';
  my %bighash;   if (!$map && $resid == 0 && $url =~/default\.sequence$/) {
  if (tie(%bighash,'GDBM_File',$env{'request.course.fn'}.'.db',      $title = $env{'course.'.$env{'request.course.id'}.'.description'};
  &GDBM_READER(),0640)) {   } else {
     my $mapid=$bighash{'map_pc_'.&clutter($map)};      if (tie(my %bighash,'GDBM_File',$env{'request.course.fn'}.'.db',
     $title=$bighash{'title_'.$mapid.'.'.$resid};      &GDBM_READER(),0640)) {
     untie %bighash;   my $mapid=$bighash{'map_pc_'.&clutter($map)};
    $title=$bighash{'title_'.$mapid.'.'.$resid};
    untie(%bighash);
       }
  }   }
  $title=~s/\&colon\;/\:/gs;   $title=~s/\&colon\;/\:/gs;
  if ($title) {   if ($title) {
Line 8551  explanation of a user role term Line 8571  explanation of a user role term
 get_my_roles($uname,$udom,$context,$types,$roles,$roledoms) :  get_my_roles($uname,$udom,$context,$types,$roles,$roledoms) :
 All arguments are optional. Returns a hash of a roles, either for  All arguments are optional. Returns a hash of a roles, either for
 co-author/assistant author roles for a user's Construction Space  co-author/assistant author roles for a user's Construction Space
 (default), or if $context is 'user', roles for the user himself,  (default), or if $context is 'userroles', roles for the user himself,
 In the hash, keys are set to colon-sparated $uname,$udom,and $role,  In the hash, keys are set to colon-sparated $uname,$udom,and $role,
 and value is set to colon-separated start and end times for the role.  and value is set to colon-separated start and end times for the role.
 If no username and domain are specified, will default to current  If no username and domain are specified, will default to current

Removed from v.1.902  
changed lines
  Added in v.1.907


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