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

raeburn raeburn at source.lon-capa.org
Wed Oct 9 13:56:24 EDT 2024


raeburn		Wed Oct  9 17:56:24 2024 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/auth	lonauth.pm 
  Log:
  - If Remote Control is set to be used for current user, don't launch it if
    server is a loadbalancer, and session will be switched elsewhere immediately. 
  
  
Index: loncom/auth/lonauth.pm
diff -u loncom/auth/lonauth.pm:1.121.2.26 loncom/auth/lonauth.pm:1.121.2.27
--- loncom/auth/lonauth.pm:1.121.2.26	Mon Feb 28 01:07:15 2022
+++ loncom/auth/lonauth.pm	Wed Oct  9 17:56:24 2024
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # User Authentication Module
 #
-# $Id: lonauth.pm,v 1.121.2.26 2022/02/28 01:07:15 raeburn Exp $
+# $Id: lonauth.pm,v 1.121.2.27 2024/10/09 17:56:24 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -149,6 +149,27 @@
     }
 
     my $windowinfo=&Apache::lonmenu::open($env{'browser.os'});
+    if ($env{'environment.remote'} eq 'on') {
+        my $checkexempt;
+        if ($env{'user.loadbalexempt'} eq $r->dir_config('lonHostID')) {
+            if ($env{'user.loadbalcheck.time'} + 600 > time) {
+                $checkexempt = 1;
+            }
+        }
+        if ($env{'user.noloadbalance'} eq $r->dir_config('lonHostID')) {
+            $checkexempt = 1;
+        }
+        unless (($checkexempt) || 
+                (($destination =~ m{^/adm/switchserver}) && (!$r->is_initial_req()))) {
+            my ($is_balancer,$otherserver) =
+                &Apache::lonnet::check_loadbalancing($env{'user.name'},
+                                                     $env{'user.domain'});
+            if (($is_balancer) && ($otherserver ne '') && 
+                ($otherserver ne $r->dir_config('lonHostID'))) {
+                $env{'environment.remote'} = 'off';
+            }
+        }
+    }
     my $startupremote=&Apache::lonmenu::startupremote($destination);
     my $remoteinfo=&Apache::lonmenu::load_remote_msg($lowerurl);
     my $setflags=&Apache::lonmenu::setflags();




More information about the LON-CAPA-cvs mailing list