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

banghart lon-capa-cvs@mail.lon-capa.org
Mon, 19 Jun 2006 21:01:04 -0000


banghart		Mon Jun 19 17:01:04 2006 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  	Return reason for file marked as readonly.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.749 loncom/lonnet/perl/lonnet.pm:1.750
--- loncom/lonnet/perl/lonnet.pm:1.749	Fri Jun 16 18:37:35 2006
+++ loncom/lonnet/perl/lonnet.pm	Mon Jun 19 17:01:01 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.749 2006/06/16 22:37:35 raeburn Exp $
+# $Id: lonnet.pm,v 1.750 2006/06/19 21:01:01 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4846,12 +4846,18 @@
         if (ref($value) eq "ARRAY"){
             foreach my $stored_what (@{$value}) {
                 if (ref($stored_what) eq 'ARRAY') {
-                    if ($stored_what eq $what) {
-                        $readonly_files{$file_name} = 'locked';
-                    } elsif (!defined($what)) {
-                        $readonly_files{$file_name} = 'locked';
+                    foreach my $lock_descriptor(@{$stored_what}) {
+                        if ($lock_descriptor eq 'graded') {
+                            $readonly_files{$file_name} = 'graded';
+                        } elsif ($lock_descriptor eq 'handback') {
+                            $readonly_files{$file_name} = 'handback';
+                        } else {
+                            if (!exists($readonly_files{$file_name})) {
+                                $readonly_files{$file_name} = 'locked';
+                            }
+                        }
                     }
-                }
+                } 
             }
         } 
     }
@@ -4917,7 +4923,7 @@
     if(defined($alternateDirectoryRoot)) {
         $dirRoot = $alternateDirectoryRoot;
         $dirRoot =~ s/\/$//;
-    }
+    }Clay Greene
 
     if($udom) {
         if($uname) {