[LON-CAPA-cvs] cvs: rat / lonuserstate.pm loncom/lonnet/perl lonnet.pm
www
lon-capa-cvs@mail.lon-capa.org
Sat, 17 Aug 2002 18:23:27 -0000
www Sat Aug 17 14:23:27 2002 EDT
Modified files:
/loncom/lonnet/perl lonnet.pm
/rat lonuserstate.pm
Log:
"uploaded" is starting to become recognized top-level in addition to
adm and priv. Problem to work around: /res is always stripped by default in
declutter.
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.267 loncom/lonnet/perl/lonnet.pm:1.268
--- loncom/lonnet/perl/lonnet.pm:1.267 Tue Aug 13 10:37:52 2002
+++ loncom/lonnet/perl/lonnet.pm Sat Aug 17 14:23:27 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.267 2002/08/13 14:37:52 albertel Exp $
+# $Id: lonnet.pm,v 1.268 2002/08/17 18:23:27 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3132,6 +3132,14 @@
$thisfn=~s/^\///;
$thisfn=~s/^res\///;
$thisfn=~s/\?.+$//;
+ return $thisfn;
+}
+
+# ------------------------------------------------------------- Clutter up URLs
+
+sub clutter {
+ my $thisfn='/'.&declutter(shift);
+ unless ($thisfn=~/^\/(uploaded|adm)\//) { $thisfn='/res'.$thisfn; }
return $thisfn;
}
Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.37 rat/lonuserstate.pm:1.38
--- rat/lonuserstate.pm:1.37 Sat Aug 17 13:40:06 2002
+++ rat/lonuserstate.pm Sat Aug 17 14:23:27 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Construct and maintain state and binary representation of course for user
#
-# $Id: lonuserstate.pm,v 1.37 2002/08/17 17:40:06 www Exp $
+# $Id: lonuserstate.pm,v 1.38 2002/08/17 18:23:27 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -462,7 +462,7 @@
%parmhash=();
$errtext='';
$pc=0;
- my $furi='/res/'.&Apache::lonnet::declutter($uri);
+ my $furi=&Apache::lonnet::clutter($uri);
$hash{'src_0.0'}=$furi;
$hash{'title_0.0'}=&Apache::lonnet::metadata($uri,'title');
$hash{'ids_'.$furi}='0.0';