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

raeburn raeburn at source.lon-capa.org
Tue Aug 21 17:12:09 EDT 2012


raeburn		Tue Aug 21 21:12:09 2012 EDT

  Modified files:              
    /loncom/interface	domainprefs.pm 
  Log:
  - Bug 1320
    - Fix change in rev. 1.157 so domain images are stored in the right place.
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.163 loncom/interface/domainprefs.pm:1.164
--- loncom/interface/domainprefs.pm:1.163	Tue Aug 14 15:45:06 2012
+++ loncom/interface/domainprefs.pm	Tue Aug 21 21:12:08 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.163 2012/08/14 15:45:06 raeburn Exp $
+# $Id: domainprefs.pm,v 1.164 2012/08/21 21:12:08 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5047,15 +5047,17 @@
 # See if there is anything left
     unless ($fname) { return ('error: no uploaded file'); }
     $fname="$subdir/$fname";
-    my $filepath=$r->dir_config('lonDocRoot')."/priv/$dom/$confname";
+    my $docroot=$r->dir_config('lonDocRoot'); 
+    my $filepath="$docroot/priv";
+    my $relpath = "$dom/$confname";
     my ($fnamepath,$file,$fetchthumb);
     $file=$fname;
     if ($fname=~m|/|) {
         ($fnamepath,$file) = ($fname =~ m|^(.*)/([^/]+)$|);
     }
-    my @parts=split(/\//,$filepath.'/'.$fnamepath);
+    my @parts=split(/\//,"$filepath/$relpath/$fnamepath");
     my $count;
-    for ($count=4;$count<=$#parts;$count++) {
+    for ($count=5;$count<=$#parts;$count++) {
         $filepath.="/$parts[$count]";
         if ((-e $filepath)!=1) {
             mkdir($filepath,02770);
@@ -5102,7 +5104,6 @@
         close(FH);
         chmod(0660, $source); # Permissions to rw-rw---.
 
-        my $docroot=$r->dir_config('lonDocRoot');
         my $targetdir=$docroot.'/res/'.$dom.'/'.$confname .'/'.$fnamepath;
         my $copyfile=$targetdir.'/'.$file;
 




More information about the LON-CAPA-cvs mailing list