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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Fri, 24 Aug 2007 22:58:18 -0000


albertel		Fri Aug 24 18:58:18 2007 EDT

  Modified files:              
    /loncom/homework	lonhomework.pm 
  Log:
  - BUG#5388 & 4901, switch to using the stored user IP address taher than the active REMOTE_ADDR, since when lonnet::ssi's occur REMOTE_ADDR is set to the server's IP
  
  
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.271 loncom/homework/lonhomework.pm:1.272
--- loncom/homework/lonhomework.pm:1.271	Fri Aug 24 17:13:53 2007
+++ loncom/homework/lonhomework.pm	Fri Aug 24 18:58:18 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.271 2007/08/24 21:13:53 albertel Exp $
+# $Id: lonhomework.pm,v 1.272 2007/08/24 22:58:18 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -195,7 +195,8 @@
 	return 1;
     }
     my $allowed=0;
-    my $ip=$ENV{'REMOTE_ADDR'};
+    my $ip=$env{'request.host'} || $ENV{'REMOTE_ADDR'};
+
     my $name;
     foreach my $pattern (split(',',$acc)) {
 	$pattern =~ s/^\s*//;