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

banghart lon-capa-cvs@mail.lon-capa.org
Fri, 09 Jul 2004 16:36:09 -0000


banghart		Fri Jul  9 12:36:09 2004 EDT

  Modified files:              
    /loncom/interface	portfolio.pm 
  Log:
  	Now uses lonnet::dirlist instead of lonnet::portfoliolist
  
  
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.11 loncom/interface/portfolio.pm:1.12
--- loncom/interface/portfolio.pm:1.11	Fri Jul  2 20:35:01 2004
+++ loncom/interface/portfolio.pm	Fri Jul  9 12:36:09 2004
@@ -213,9 +213,12 @@
     # we always need $dirList, plus this will return information about the current file
     # as well as information about he home server directory structure, specifically
     # the path to the users userfiles directory.    
-	my $list = &Apache::lonnet::portfoliolist($currentPath, $currentFile);
-	@dirList = split(/:/,$list);
-    if (@dirList == 2){ # need to know if directory is empty to it can be removed if desired
+    my $portfolioRoot = '/home/httpd/lonUsers/'.$ENV{'user.domain'}.'/';
+    $ENV{'user.name'} =~ /^(.?)(.?)(.?)/;
+    $portfolioRoot = $portfolioRoot.$1.'/'.$2.'/'.$3.'/'.$ENV{'user.name'}.'/userfiles/portfolio';
+    my @list = &Apache::lonnet::dirlist($currentPath,  $ENV{'user.domain'}, $ENV{'user.name'}, $portfolioRoot);
+    @dirList = @list;
+    if (@dirList == 2) { # need to know if directory is empty so it can be removed if desired
         $isEmpty = 1;
     }else{
         $isEmpty = 0;