[LON-CAPA-cvs] cvs: loncom /interface lonaboutme.pm /lonnet/perl lonnet.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 02 Aug 2006 19:29:35 -0000


albertel		Wed Aug  2 15:29:35 2006 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
    /loncom/interface	lonaboutme.pm 
  Log:
  - making file listing actually work 
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.766 loncom/lonnet/perl/lonnet.pm:1.767
--- loncom/lonnet/perl/lonnet.pm:1.766	Fri Jul 21 15:42:25 2006
+++ loncom/lonnet/perl/lonnet.pm	Wed Aug  2 15:29:32 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.766 2006/07/21 19:42:25 albertel Exp $
+# $Id: lonnet.pm,v 1.767 2006/08/02 19:29:32 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3232,14 +3232,17 @@
 }
 
 sub get_portfolio_access {
-    my ($udom,$unum,$file_name,$group) = @_;
- 
-    my $current_perms = &get_portfile_permissions($udom,$unum);
-    my %access_controls = &get_access_controls($current_perms,$group,
-					       $file_name);
+    my ($udom,$unum,$file_name,$group,$access_hash) = @_;
+
+    if (!ref($access_hash)) {
+	my $current_perms = &get_portfile_permissions($udom,$unum);
+	my %access_controls = &get_access_controls($current_perms,$group,
+						   $file_name);
+	$access_hash = $access_controls{$file_name};
+    }
+
     my ($public,$guest,@domains,@users,@courses,@groups);
     my $now = time;
-    my $access_hash = $access_controls{$file_name};
     if (ref($access_hash) eq 'HASH') {
         foreach my $key (keys(%{$access_hash})) {
             my ($num,$scope,$end,$start) = ($key =~ /^([^:]+):([a-z]+)_(\d*)_?(\d*)$/);
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.43 loncom/interface/lonaboutme.pm:1.44
--- loncom/interface/lonaboutme.pm:1.43	Tue Aug  1 23:05:10 2006
+++ loncom/interface/lonaboutme.pm	Wed Aug  2 15:29:35 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "About Me" Personal Information
 #
-# $Id: lonaboutme.pm,v 1.43 2006/08/02 03:05:10 raeburn Exp $
+# $Id: lonaboutme.pm,v 1.44 2006/08/02 19:29:35 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -389,9 +389,9 @@
                        both        => 0,
                      };
     my $current_permissions =
-                  &Apache::lonnet::get_portfile_permissions($cdom,$cnum);
+	&Apache::lonnet::get_portfile_permissions($cdom,$cnum);
     my %access_controls = 
-                  &Apache::lonnet::get_access_controls($current_permissions);
+	&Apache::lonnet::get_access_controls($current_permissions);
     my %allfileshash;
     my $portaccess;
     if ($mode eq 'showlink') {
@@ -405,7 +405,8 @@
 
     foreach my $filename (keys(%access_controls)) {
         my $access_status = 
-            &Apache::lonnet::get_portfolio_access($access_controls{$filename}); 
+            &Apache::lonnet::get_portfolio_access($cdom,$cnum,$filename,undef,
+						  $access_controls{$filename});
         if ($portaccess eq 'both') {
             if (($access_status ne 'ok') &&
                 ($access_status !~  /^[^:]+:guest_/)) {