[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /auth switchserver.pm

raeburn raeburn at source.lon-capa.org
Fri Oct 23 17:26:32 EDT 2020


raeburn		Fri Oct 23 21:26:32 2020 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/auth	switchserver.pm 
  Log:
  - For 2.11
    Backport 1.50, 1.51
  
  
Index: loncom/auth/switchserver.pm
diff -u loncom/auth/switchserver.pm:1.35.2.2 loncom/auth/switchserver.pm:1.35.2.3
--- loncom/auth/switchserver.pm:1.35.2.2	Sat Aug  3 23:27:39 2019
+++ loncom/auth/switchserver.pm	Fri Oct 23 21:26:32 2020
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Switch Servers Handler
 #
-# $Id: switchserver.pm,v 1.35.2.2 2019/08/03 23:27:39 raeburn Exp $
+# $Id: switchserver.pm,v 1.35.2.3 2020/10/23 21:26:32 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -223,14 +223,15 @@
 	return OK;
     }
 # -------------------------------------------------------- Menu script and info
-	   
+
 # ---------------------------------------------------------------- Get handover
 
-    my $newcookieid;
+    my ($is_balancer,$setcookie,$newcookieid);
     my $only_body = 0;
-    my ($is_balancer,$posshost,$setcookie) =
-        &Apache::lonnet::check_loadbalancing($env{'user.name'},$env{'user.domain'});
+    ($is_balancer,undef,$setcookie) =
+        &Apache::lonnet::check_loadbalancing($env{'user.name'},$env{'user.domain'},'switchserver');
     if ($is_balancer && $setcookie && $env{'form.otherserver'}) {
+
         # Set a balancer cookie unless browser already sent LON-CAPA load balancer
         # cookie which points at the target server
         my ($found_server,$balancer_cookie) = &Apache::lonnet::check_for_balancer_cookie($r,1);
@@ -243,6 +244,9 @@
                                               $env{'user.name'},$env{'user.domain'});
         }
     }
+    if ((!$is_balancer) && ($env{'request.balancercookie'})) {
+        $otherbalcookie = $env{'request.balancercookie'};
+    }
 
     my %info=('ip'       => $ENV{'REMOTE_ADDR'},
 	      'domain'   => $env{'user.domain'},
@@ -252,6 +256,8 @@
 	      'balancer' => $is_balancer);
     if ($newcookieid) {
         $info{'balcookie'} = $newcookieid;
+    } elsif ($otherbalcookie) {
+        $info{'otherbalcookie'} = $otherbalcookie;
     }
     if ($env{'form.origurl'}) {
         $info{'origurl'} = $env{'form.origurl'};




More information about the LON-CAPA-cvs mailing list