--- loncom/lond 2008/04/16 22:51:21 1.399 +++ loncom/lond 2008/05/30 21:33:21 1.403 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.399 2008/04/16 22:51:21 raeburn Exp $ +# $Id: lond,v 1.403 2008/05/30 21:33:21 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -59,7 +59,7 @@ my $DEBUG = 0; # Non zero to ena my $status=''; my $lastlog=''; -my $VERSION='$Revision: 1.399 $'; #' stupid emacs +my $VERSION='$Revision: 1.403 $'; #' stupid emacs my $remoteVERSION; my $currenthostid="default"; my $currentdomainid; @@ -1535,11 +1535,15 @@ sub ls3_handler { &Failure($client,"refused\n","$cmd:$tail"); return 1; } - } elsif (defined($alternate_root)) { + } elsif ($alternate_root ne '') { $dir_root = $alternate_root; } - if (defined($dir_root)) { - $ulsdir = $dir_root.'/'.$ulsdir; + if ($dir_root ne '') { + if ($ulsdir =~ /^\//) { + $ulsdir = $dir_root.$ulsdir; + } else { + $ulsdir = $dir_root.'/'.$ulsdir; + } } my $obs; my $rights; @@ -1576,10 +1580,10 @@ sub ls3_handler { } } else { $ulsout='no_such_dir'; - } - if ($ulsout eq '') { $ulsout='empty'; } - &Reply($client, \$ulsout, $userinput); # This supports debug logging. - return 1; + } + if ($ulsout eq '') { $ulsout='empty'; } + &Reply($client, \$ulsout, $userinput); # This supports debug logging. + return 1; } ®ister_handler("ls3", \&ls3_handler, 0, 1, 0); @@ -3622,7 +3626,7 @@ sub dump_course_id_handler { my $userinput = "$cmd:$tail"; my ($udom,$since,$description,$instcodefilter,$ownerfilter,$coursefilter, - $typefilter,$regexp_ok,$rtn_as_hash,$selfenrollonly) =split(/:/,$tail); + $typefilter,$regexp_ok,$rtn_as_hash,$selfenrollonly,$catfilter) =split(/:/,$tail); my $now = time; if (defined($description)) { $description=&unescape($description); @@ -3663,6 +3667,9 @@ sub dump_course_id_handler { if (defined($regexp_ok)) { $regexp_ok=&unescape($regexp_ok); } + if (defined($catfilter)) { + $catfilter=&unescape($catfilter); + } my $unpack = 1; if ($description eq '.' && $instcodefilter eq '.' && $coursefilter eq '.' && $typefilter eq '.') { @@ -3701,12 +3708,19 @@ sub dump_course_id_handler { next; } } + if ($catfilter ne '') { + next if ($items->{'category'} ne $catfilter); + } } } else { + next if ($catfilter ne ''); + next if ($selfenrollonly); $is_hash = 0; my @courseitems = split(/:/,$value); $lasttime = pop(@courseitems); - next if ($lasttime<$since); + if ($hashref->{$lasttime_key} eq '') { + next if ($lasttime<$since); + } ($val{'descr'},$val{'inst_code'},$val{'owner'},$val{'type'}) = @courseitems; } my $match = 1;