[LON-CAPA-cvs] cvs: loncom /homework externalresponse.pm

raeburn raeburn at source.lon-capa.org
Sat Dec 6 21:48:55 EST 2014


raeburn		Sun Dec  7 02:48:55 2014 EDT

  Modified files:              
    /loncom/homework	externalresponse.pm 
  Log:
  - Bug 6690
    Revoke IP-based access for grading server for portfolio files submitted 
    to externalresponse following grading.
  
  
Index: loncom/homework/externalresponse.pm
diff -u loncom/homework/externalresponse.pm:1.29 loncom/homework/externalresponse.pm:1.30
--- loncom/homework/externalresponse.pm:1.29	Sat Dec  6 20:08:16 2014
+++ loncom/homework/externalresponse.pm	Sun Dec  7 02:48:55 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # external style responses
 #
-# $Id: externalresponse.pm,v 1.29 2014/12/06 20:08:16 raeburn Exp $
+# $Id: externalresponse.pm,v 1.30 2014/12/07 02:48:55 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -150,7 +150,7 @@
                            $env{'form.HWFILETOOBIG'.$part.'_'.$id};
             my $portfiles = $env{'form.HWPORT'.$jspart.'_'.$id};
             my @deletions = &Apache::loncommon::get_env_multiple('form.HWFILE'.$jspart.'_'.$id.'_delete');
-            my ($is_submit,$was_draft,$externalgrade);
+            my ($is_submit,$was_draft,$externalgrade,%info);
             if ($env{'form.HWDRAFT'.$part.'_'.$id} eq 'yes') {
                  $is_submit = 1;
             }
@@ -173,9 +173,9 @@
                 }
                 my $uploadedflag=0;
                 my $totalsize=0;
-                my %info = (
-                             'is_submit' => $is_submit,
-                           );
+                %info = (
+                            'is_submit' => $is_submit,
+                        );
                 my $url = &Apache::lonxml::get_param('url',$parstack,$safeeval);
                 if ($url =~ m{^https?://([^/]+)/}) {
                     use Socket;
@@ -265,6 +265,8 @@
                 my %record = &Apache::lonnet::restore($symb,$env{'request.course.id'},$udom,$uname);
 		my $ua = LWP::UserAgent->new;
 		my $res = $ua->request(POST $url, \%form);
+                my @delaccess = keys(%currently_turned_in);
+                &Apache::lonnet::automated_portfile_access('ip',undef,\@delaccess,\%info);
 		%Apache::loncapagrade::results=();
 		$Apache::lonhomework::results{"resource.$part.$id.submission"}=$response;
 		if ($res->is_error()) {




More information about the LON-CAPA-cvs mailing list