[LON-CAPA-cvs] cvs: loncom /interface lonhelper.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 12 Aug 2004 07:45:04 -0000


albertel		Thu Aug 12 03:45:04 2004 EDT

  Modified files:              
    /loncom/interface	lonhelper.pm 
  Log:
  - when priting from a Co-Author CSTR dir, everything looked unpublished (BUG#2540)
  
  
Index: loncom/interface/lonhelper.pm
diff -u loncom/interface/lonhelper.pm:1.85 loncom/interface/lonhelper.pm:1.86
--- loncom/interface/lonhelper.pm:1.85	Thu Aug 12 01:44:36 2004
+++ loncom/interface/lonhelper.pm	Thu Aug 12 03:45:03 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # .helper XML handler to implement the LON-CAPA helper
 #
-# $Id: lonhelper.pm,v 1.85 2004/08/12 05:44:36 albertel Exp $
+# $Id: lonhelper.pm,v 1.86 2004/08/12 07:45:03 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2548,10 +2548,14 @@
     my $constructionSpaceDir = shift;
     my $file = shift;
     
+    my ($uname,$udom)=($ENV{'user.name'},$ENV{'user.domain'});
+    if ($ENV{'request.role'}=~/^ca\./) {
+	(undef,$udom,$uname)=split(/\//,$ENV{'request.role'});
+    }
     my $docroot = $Apache::lonnet::perlvar{'lonDocRoot'};
     my $subdirpart = $constructionSpaceDir;
-    $subdirpart =~ s/^\/home\/$ENV{'user.name'}\/public_html//;
-    my $resdir = $docroot . '/res/' . $ENV{'user.domain'} . '/' . $ENV{'user.name'} .
+    $subdirpart =~ s/^\/home\/$uname\/public_html//;
+    my $resdir = $docroot . '/res/' . $udom . '/' . $uname .
         $subdirpart;
 
     my @constructionSpaceFileStat = stat($constructionSpaceDir . '/' . $file);