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

raeburn raeburn at source.lon-capa.org
Thu Apr 8 20:57:32 EDT 2021


raeburn		Fri Apr  9 00:57:32 2021 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - Fix typo in rev. 1.1444
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1075.2.141.2.10 loncom/interface/loncommon.pm:1.1075.2.141.2.11
--- loncom/interface/loncommon.pm:1.1075.2.141.2.10	Fri Nov 13 02:50:39 2020
+++ loncom/interface/loncommon.pm	Mon Jan  4 05:10:35 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1075.2.141.2.10 2020/11/13 02:50:39 raeburn Exp $
+# $Id: loncommon.pm,v 1.1075.2.141.2.11 2021/01/04 05:10:35 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5116,7 +5116,8 @@
         ($ENV{'REMOTE_ADDR'} eq &Apache::lonnet::get_host_ip($Apache::lonnet::perlvar{'lonHostID'}))) {
         $ip = $env{'request.host'} || $ENV{'REMOTE_ADDR'} || $clientip;
     } else {
-        $ip = $ENV{'REMOTE_ADDR'} || $env{'request.host'} || $clientip;
+        my $remote_ip = &Apache::lonnet::get_requestor_ip(); 
+        $ip = $remote_ip || $env{'request.host'} || $clientip;
     }
 
     my $name;
@@ -15973,6 +15974,7 @@
 # --------------------------------------------------------- Write first profile
 
     {
+        my $ip = &Apache::lonnet::get_requestor_ip();
 	my %initial_env = 
 	    ("user.name"          => $username,
 	     "user.domain"        => $domain,
@@ -15991,7 +15993,7 @@
 	     "request.course.sec" => '',
 	     "request.role"       => 'cm',
 	     "request.role.adv"   => $env{'user.adv'},
-	     "request.host"       => $ENV{'REMOTE_ADDR'},);
+	     "request.host"       => $ip,);
 
         if ($form->{'localpath'}) {
 	    $initial_env{"browser.localpath"}  = $form->{'localpath'};
@@ -17241,13 +17243,14 @@
 sub check_recaptcha {
     my ($privkey,$version) = @_;
     my $captcha_chk;
+    my $ip = &Apache::lonnet::get_requestor_ip();
     if ($version >= 2) {
         my $ua = LWP::UserAgent->new;
         $ua->timeout(10);
         my %info = (
                      secret   => $privkey,
                      response => $env{'form.g-recaptcha-response'},
-                     remoteip => $ENV{'REMOTE_ADDR'},
+                     remoteip => $ip,
                    );
         my $response = $ua->post('https://www.google.com/recaptcha/api/siteverify',\%info);
         if ($response->is_success)  {
@@ -17263,7 +17266,7 @@
         my $captcha_result =
             $captcha->check_answer(
                                     $privkey,
-                                    $ENV{'REMOTE_ADDR'},
+                                    $ip,
                                     $env{'form.recaptcha_challenge_field'},
                                     $env{'form.recaptcha_response_field'},
                                   );
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1444 loncom/lonnet/perl/lonnet.pm:1.1445
--- loncom/lonnet/perl/lonnet.pm:1.1444	Wed Mar 31 02:19:59 2021
+++ loncom/lonnet/perl/lonnet.pm	Fri Apr  9 00:57:31 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1444 2021/03/31 02:19:59 raeburn Exp $
+# $Id: lonnet.pm,v 1.1445 2021/04/09 00:57:31 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -9441,7 +9441,7 @@
     unless (($homeserver eq '') || ($homeserver eq 'no_host')) {
         $response=&reply('autovalidateinstcrosslist:'.$cdom.':'.
                          &escape($instcode).':'.&escape($inst_xlist).':'.
-                         &escape($coowner),$homeserver)));
+                         &escape($coowner),$homeserver);
     }
     return $response;
 }




More information about the LON-CAPA-cvs mailing list