version 1.399, 2008/04/16 22:51:21
|
version 1.408, 2008/09/06 00:47:13
|
Line 1535 sub ls3_handler {
|
Line 1535 sub ls3_handler {
|
&Failure($client,"refused\n","$cmd:$tail"); |
&Failure($client,"refused\n","$cmd:$tail"); |
return 1; |
return 1; |
} |
} |
} elsif (defined($alternate_root)) { |
} elsif ($alternate_root ne '') { |
$dir_root = $alternate_root; |
$dir_root = $alternate_root; |
} |
} |
if (defined($dir_root)) { |
if (($dir_root ne '') && ($dir_root ne '/')) { |
$ulsdir = $dir_root.'/'.$ulsdir; |
if ($ulsdir =~ /^\//) { |
|
$ulsdir = $dir_root.$ulsdir; |
|
} else { |
|
$ulsdir = $dir_root.'/'.$ulsdir; |
|
} |
} |
} |
my $obs; |
my $obs; |
my $rights; |
my $rights; |
Line 1576 sub ls3_handler {
|
Line 1580 sub ls3_handler {
|
} |
} |
} else { |
} else { |
$ulsout='no_such_dir'; |
$ulsout='no_such_dir'; |
} |
} |
if ($ulsout eq '') { $ulsout='empty'; } |
if ($ulsout eq '') { $ulsout='empty'; } |
&Reply($client, \$ulsout, $userinput); # This supports debug logging. |
&Reply($client, \$ulsout, $userinput); # This supports debug logging. |
return 1; |
return 1; |
} |
} |
®ister_handler("ls3", \&ls3_handler, 0, 1, 0); |
®ister_handler("ls3", \&ls3_handler, 0, 1, 0); |
|
|
Line 3611 sub put_course_id_hash_handler {
|
Line 3615 sub put_course_id_hash_handler {
|
# key, value pairs in the item's hash, or as a |
# key, value pairs in the item's hash, or as a |
# colon-separated list of (in order) description, |
# colon-separated list of (in order) description, |
# institutional code, and course owner. |
# institutional code, and course owner. |
# |
# selfenrollonly - filter by courses allowing self-enrollment |
|
# now or in the future (selfenrollonly = 1). |
|
# catfilter - filter by course category, assigned to a course |
|
# using manually defined categories (i.e., not |
|
# self-cataloging based on on institutional code). |
|
# showhidden - include course in results even if course |
|
# was set to be excluded from course catalog (DC only). |
|
# caller - if set to 'coursecatalog', courses set to be hidden |
|
# from course catalog will be excluded from results (unless |
|
# overridden by "showhidden". |
|
# |
# $client - The socket open on the client. |
# $client - The socket open on the client. |
# Returns: |
# Returns: |
# 1 - Continue processing. |
# 1 - Continue processing. |
Line 3622 sub dump_course_id_handler {
|
Line 3636 sub dump_course_id_handler {
|
my $userinput = "$cmd:$tail"; |
my $userinput = "$cmd:$tail"; |
|
|
my ($udom,$since,$description,$instcodefilter,$ownerfilter,$coursefilter, |
my ($udom,$since,$description,$instcodefilter,$ownerfilter,$coursefilter, |
$typefilter,$regexp_ok,$rtn_as_hash,$selfenrollonly) =split(/:/,$tail); |
$typefilter,$regexp_ok,$rtn_as_hash,$selfenrollonly,$catfilter,$showhidden, |
|
$caller) =split(/:/,$tail); |
my $now = time; |
my $now = time; |
if (defined($description)) { |
if (defined($description)) { |
$description=&unescape($description); |
$description=&unescape($description); |
Line 3663 sub dump_course_id_handler {
|
Line 3678 sub dump_course_id_handler {
|
if (defined($regexp_ok)) { |
if (defined($regexp_ok)) { |
$regexp_ok=&unescape($regexp_ok); |
$regexp_ok=&unescape($regexp_ok); |
} |
} |
|
if (defined($catfilter)) { |
|
$catfilter=&unescape($catfilter); |
|
} |
my $unpack = 1; |
my $unpack = 1; |
if ($description eq '.' && $instcodefilter eq '.' && $coursefilter eq '.' && |
if ($description eq '.' && $instcodefilter eq '.' && $coursefilter eq '.' && |
$typefilter eq '.') { |
$typefilter eq '.') { |
Line 3693 sub dump_course_id_handler {
|
Line 3711 sub dump_course_id_handler {
|
$unesc_val{'inst_code'} = $items->{'inst_code'}; |
$unesc_val{'inst_code'} = $items->{'inst_code'}; |
$unesc_val{'owner'} = $items->{'owner'}; |
$unesc_val{'owner'} = $items->{'owner'}; |
$unesc_val{'type'} = $items->{'type'}; |
$unesc_val{'type'} = $items->{'type'}; |
$selfenroll_types = $items->{'selfenroll_types'}; |
} |
$selfenroll_end = $items->{'selfenroll_end_date'}; |
$selfenroll_types = $items->{'selfenroll_types'}; |
if ($selfenrollonly) { |
$selfenroll_end = $items->{'selfenroll_end_date'}; |
next if (!$selfenroll_types); |
if ($selfenrollonly) { |
if (($selfenroll_end > 0) && ($selfenroll_end <= $now)) { |
next if (!$selfenroll_types); |
next; |
if (($selfenroll_end > 0) && ($selfenroll_end <= $now)) { |
|
next; |
|
} |
|
} |
|
if ($catfilter ne '') { |
|
next if ($items->{'categories'} eq ''); |
|
my @categories = split('&',$items->{'categories'}); |
|
next if (@categories == 0); |
|
my @subcats = split('&',$catfilter); |
|
my $matchcat = 0; |
|
foreach my $cat (@categories) { |
|
if (grep(/^\Q$cat\E$/,@subcats)) { |
|
$matchcat = 1; |
|
last; |
} |
} |
} |
} |
|
next if (!$matchcat); |
|
} |
|
if ($caller eq 'coursecatalog') { |
|
if ($items->{'hidefromcat'} eq 'yes') { |
|
next if !$showhidden; |
|
} |
} |
} |
} else { |
} else { |
|
next if ($catfilter ne ''); |
|
next if ($selfenrollonly); |
$is_hash = 0; |
$is_hash = 0; |
my @courseitems = split(/:/,$value); |
my @courseitems = split(/:/,$value); |
$lasttime = pop(@courseitems); |
$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; |
($val{'descr'},$val{'inst_code'},$val{'owner'},$val{'type'}) = @courseitems; |
} |
} |
my $match = 1; |
my $match = 1; |