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

banghart lon-capa-cvs@mail.lon-capa.org
Tue, 02 Nov 2004 14:35:43 -0000


banghart		Tue Nov  2 09:35:43 2004 EDT

  Modified files:              
    /loncom/interface	portfolio.pm 
  Log:
  	Reads list of locked files (submitted in essay response)
  	Still needs to do something with the list in restricting
  	actions on locked files.
  
  
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.52 loncom/interface/portfolio.pm:1.53
--- loncom/interface/portfolio.pm:1.52	Mon Oct 25 13:00:25 2004
+++ loncom/interface/portfolio.pm	Tue Nov  2 09:35:42 2004
@@ -82,6 +82,12 @@
     my ($r,$current_path,$is_empty,$dir_list)=@_;
     my $iconpath= $r->dir_config('lonIconsURL') . "/";
     my $display_out;
+    my %locked_files=&Apache::lonnet::dump('file_permissions',
+                                  $ENV{'user.domain'},$ENV{'user.name'});
+    my $locked_file;
+    foreach my $key (keys %locked_files) {
+        $locked_file .= $locked_files{$key}.':';
+    }
     if ($is_empty && ($current_path ne '/')) {
         $display_out = '<form method="post" action="/adm/portfolio">'.
         '<input type="hidden" name="action" value="deletedir" />'.
@@ -105,6 +111,13 @@
     	#$strip holds directory/file name
     	#$dom 
     	my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16); 
+    	if ($Apache::lonhomework::results{"resource.$ENV{'user.domain'}.$ENV{'user.name'}.$filename"}eq'true'){
+    	    &Apache::lonnet::logthis("found submitted file");
+    	    &Apache::lonnet::logthis("resource.$ENV{'user.domain'}.$ENV{'user.name'}.$filename");
+    	} else {
+    	    &Apache::lonnet::logthis("$filename not found submitted file");
+    	    &Apache::lonnet::logthis("resource.$ENV{'user.domain'}.$ENV{'user.name'}.$filename");
+    	}
     	if (($filename ne '.') && ($filename ne '..')) {
             if ($dirptr&$testdir) {
                 $r->print('<tr bgcolor="#FFAA99"><td><img src="'.$iconpath.'folder_closed.gif"></td>');