[LON-CAPA-cvs] cvs: loncom / loncapa_apache.conf /auth lonacc.pm /interface lonparmset.pm /lonnet/perl lonnet.pm rat lonuserstate.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 23 Apr 2004 23:01:37 -0000


albertel		Fri Apr 23 19:01:37 2004 EDT

  Modified files:              
    /loncom	loncapa_apache.conf 
    /rat	lonuserstate.pm 
    /loncom/lonnet/perl	lonnet.pm 
    /loncom/interface	lonparmset.pm 
    /loncom/auth	lonacc.pm 
  Log:
  - Somewhat amazed at how easy this was should with these changes
     - uploaded .html/.page (all ssi type docs) now
         - get parsed
         - can be printed
         - get default parameters
         - are no longer wrapper ed
  
  - .problems are still somewhat issue oriented though (need real metadata support for uploaded)
  
  
  
Index: loncom/loncapa_apache.conf
diff -u loncom/loncapa_apache.conf:1.77 loncom/loncapa_apache.conf:1.78
--- loncom/loncapa_apache.conf:1.77	Thu Apr 22 18:57:53 2004
+++ loncom/loncapa_apache.conf	Fri Apr 23 19:01:34 2004
@@ -1,7 +1,7 @@
 ##
 ## loncapa_apache.conf -- Apache HTTP LON-CAPA configuration file
 ##
-## $Id: loncapa_apache.conf,v 1.77 2004/04/22 22:57:53 albertel Exp $
+## $Id: loncapa_apache.conf,v 1.78 2004/04/23 23:01:34 albertel Exp $
 ##
 
 #
@@ -235,7 +235,7 @@
 PerlHandler Apache::lonrights
 </LocationMatch>
 
-<LocationMatch "^/+(res|\~).*\.(xml|html|htm|xhtml|xhtm|sty)$">
+<LocationMatch "^/+(uploaded|res|\~).*\.(xml|html|htm|xhtml|xhtm|sty)$">
 SetHandler perl-script
 PerlHandler Apache::lonxml
 </LocationMatch>
Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.75 rat/lonuserstate.pm:1.76
--- rat/lonuserstate.pm:1.75	Fri Apr 23 15:39:25 2004
+++ rat/lonuserstate.pm	Fri Apr 23 19:01:35 2004
@@ -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.75 2004/04/23 19:39:25 www Exp $
+# $Id: lonuserstate.pm,v 1.76 2004/04/23 23:01:35 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -160,11 +160,8 @@
                         if ($token->[2]->{'external'} eq 'true') { # external
                             $turi=~s/^http\:\/\//\/adm\/wrapper\/ext\//;
                         } elsif ($turi=~/^\/*uploaded\//) { # uploaded
-			    if (($embstyle eq 'img') || ($embstyle eq 'emb')
-                             || ($embstyle eq 'ssi')) {
-                                unless ($turi =~/\.page$/) {
-                                    $turi='/adm/wrapper'.$turi;
-                                }
+			    if (($embstyle eq 'img') || ($embstyle eq 'emb')) {
+                                $turi='/adm/wrapper'.$turi;
                             } elsif ($turi!~/\.(sequence|page)$/) {
 				$turi='/adm/coursedocs/showdoc'.$turi;
                             }
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.488 loncom/lonnet/perl/lonnet.pm:1.489
--- loncom/lonnet/perl/lonnet.pm:1.488	Fri Apr 23 15:36:46 2004
+++ loncom/lonnet/perl/lonnet.pm	Fri Apr 23 19:01:36 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.488 2004/04/23 19:36:46 albertel Exp $
+# $Id: lonnet.pm,v 1.489 2004/04/23 23:01:36 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3938,7 +3938,7 @@
     # if it is a non metadata possible uri return quickly
     if (($uri eq '') || (($uri =~ m|^/*adm/|) && ($uri !~ m|^adm/includes|)) ||
         ($uri =~ m|/$|) || ($uri =~ m|/.meta$|) || ($uri =~ /^~/) ||
-	($uri =~ m|home/[^/]+/public_html/|) || ($uri =~ m|^uploaded/|)) {
+	($uri =~ m|home/[^/]+/public_html/|)) {
 	return undef;
     }
     my $filename=$uri;
@@ -3967,7 +3967,10 @@
 	}
         my %metathesekeys=();
         unless ($filename=~/\.meta$/) { $filename.='.meta'; }
-	my $metastring=&getfile(&filelocation('',&clutter($filename)));
+	my $metastring;
+	if ($uri !~ m|^uploaded/|) {
+	    $metastring=&getfile(&filelocation('',&clutter($filename)));
+	}
         my $parser=HTML::LCParser->new(\$metastring);
         my $token;
         undef %metathesekeys;
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.153 loncom/interface/lonparmset.pm:1.154
--- loncom/interface/lonparmset.pm:1.153	Mon Apr 12 16:03:31 2004
+++ loncom/interface/lonparmset.pm	Fri Apr 23 19:01:36 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.153 2004/04/12 20:03:31 albertel Exp $
+# $Id: lonparmset.pm,v 1.154 2004/04/23 23:01:36 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1199,7 +1199,8 @@
                              '><tt><font size=-1>'.
                              join(' / ',split(/\//,$uri)).
                              '</font></tt><p><b>'.
-                             "<a href=\"javascript:openWindow('/res/".$uri.
+                             "<a href=\"javascript:openWindow('".
+				  &Apache::lonnet::clutter($uri).
                              "', 'metadatafile', '450', '500', 'no', 'yes')\";".
                              " TARGET=_self>$title");
 
Index: loncom/auth/lonacc.pm
diff -u loncom/auth/lonacc.pm:1.50 loncom/auth/lonacc.pm:1.51
--- loncom/auth/lonacc.pm:1.50	Fri Nov 21 16:27:25 2003
+++ loncom/auth/lonacc.pm	Fri Apr 23 19:01:36 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Cookie Based Access Handler
 #
-# $Id: lonacc.pm,v 1.50 2003/11/21 21:27:25 albertel Exp $
+# $Id: lonacc.pm,v 1.51 2004/04/23 23:01:36 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -70,7 +70,7 @@
 
 # -------------------------------------------------------------- Resource State
 
-            if ($requrl=~/^\/res\//) {
+            if ($requrl=~/^\/+(res|uploaded)\//) {
                $ENV{'request.state'} = "published";
 	    } else {
 	       $ENV{'request.state'} = 'unknown';