[prev in list] [next in list] [prev in thread] [next in thread]
List: lon-capa-cvs
Subject: [LON-CAPA-cvs] cvs: loncom / lond
From: raeburn <raeburn () source ! lon-capa ! org>
Date: 2018-08-09 14:07:40
Message-ID: cvsraeburn1533823660 () cvsserver
[Download RAW message or body]
raeburn Thu Aug 9 14:07:40 2018 EDT
Modified files:
/loncom lond
Log:
- Don't display folders for "in-course" authored resources in lonindexer,
when dirlist called on pre-2.12 instance.
Index: loncom/lond
diff -u loncom/lond:1.546 loncom/lond:1.547
--- loncom/lond:1.546 Thu Aug 9 13:27:55 2018
+++ loncom/lond Thu Aug 9 14:07:40 2018
@@ -2,7 +2,7 @@
# The LearningOnline Network
# lond "LON Daemon" Server (port "LOND" 5663)
#
-# $Id: lond,v 1.546 2018/08/09 13:27:55 raeburn Exp $
+# $Id: lond,v 1.547 2018/08/09 14:07:40 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -65,7 +65,7 @@
my $status='';
my $lastlog='';
-my $VERSION='$Revision: 1.546 $'; #' stupid emacs
+my $VERSION='$Revision: 1.547 $'; #' stupid emacs
my $remoteVERSION;
my $currenthostid="default";
my $currentdomainid;
@@ -1895,6 +1895,14 @@
my $rights;
my $ulsout='';
my $ulsfn;
+
+ my ($crscheck,$toplevel,$currdom,$currnum,$skip);
+ unless ($islocal) {
+ my ($major,$minor) = split(/\./,$clientversion);
+ if (($major < 2) || ($major == 2 && $minor < 12)) {
+ $crscheck = 1;
+ }
+ }
if (-e $ulsdir) {
if(-d $ulsdir) {
unless (($getpropath) || ($getuserdir) ||
@@ -1904,8 +1912,26 @@
&Failure($client,"refused\n",$userinput);
return 1;
}
- if (opendir(LSDIR,$ulsdir)) {
+ if (($crscheck) &&
+ ($ulsdir =~ \
m{^/home/httpd/html/res/($LONCAPA::match_domain)(/?$|/$LONCAPA::match_courseid)})) { \
+ ($currdom,my $posscnum) = ($1,$2); + if (($posscnum \
eq '') || ($posscnum eq '/')) { + $toplevel = 1;
+ } else {
+ $posscnum =~ s{^/+}{};
+ if (&LONCAPA::Lond::is_course($currdom,$posscnum)) {
+ $skip = 1;
+ }
+ }
+ }
+ if ((!$skip) && (opendir(LSDIR,$ulsdir))) {
while ($ulsfn=readdir(LSDIR)) {
+ if (($crscheck) && ($toplevel) && ($currdom ne '') &&
+ ($ulsfn =~ /^$LONCAPA::match_courseid$/) && (-d \
"$ulsdir/$ulsfn")) { + if \
(&LONCAPA::Lond::is_course($currdom,$ulsfn)) { + next;
+ }
+ }
undef($obs);
undef($rights);
my @ulsstats=stat($ulsdir.'/'.$ulsfn);
_______________________________________________
LON-CAPA-cvs mailing list
LON-CAPA-cvs@mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic