[LON-CAPA-cvs] cvs: loncom /auth migrateuser.pm

raeburn raeburn at source.lon-capa.org
Mon Dec 3 18:43:58 EST 2018


raeburn		Mon Dec  3 23:43:58 2018 EDT

  Modified files:              
    /loncom/auth	migrateuser.pm 
  Log:
  - Remove trailing whitespace
  - Support for multiple load balancers in a single domain
    - Repopulate $data{'offloadto'} list for different load balancer. 
  
  
Index: loncom/auth/migrateuser.pm
diff -u loncom/auth/migrateuser.pm:1.37 loncom/auth/migrateuser.pm:1.38
--- loncom/auth/migrateuser.pm:1.37	Sun Dec  2 14:41:19 2018
+++ loncom/auth/migrateuser.pm	Mon Dec  3 23:43:57 2018
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Starts a user off based of an existing token.
 #
-# $Id: migrateuser.pm,v 1.37 2018/12/02 14:41:19 raeburn Exp $
+# $Id: migrateuser.pm,v 1.38 2018/12/03 23:43:57 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -339,22 +339,20 @@
         map { $conlost{$_} = 1; } split(/,/,$data{'conlost'});
     }
     if ($data{'loncfail'}) {
-        if ($is_balancer) {
-            if ($lonhost ne $data{'from_balancer'}) {
-                my ($is_balancer,$posshost,$setcookie,$offloadto,$dom_balancers) =
-                    &Apache::lonnet::check_loadbalancing($data{'username'},$data{'domain'});
-                if ($is_balancer) {
-                    if (ref($offloadto) eq 'HASH') {
-                        $data{'offloadto'} = '';
-                        foreach my $key (keys(%{$offloadto})) {
-                            if (ref($offloadto->{$key}) eq 'ARRAY') {
-                                $data{'offloadto'} .= $key.'='.join(',',@{$offloadto->{$key}}).'&';
-                            }
+        if ($lonhost ne $data{'from_balancer'}) {
+            my ($is_balancer,$posshost,$setcookie,$offloadto,$dom_balancers) =
+                &Apache::lonnet::check_loadbalancing($data{'username'},$data{'domain'});
+            if ($is_balancer) {
+                if (ref($offloadto) eq 'HASH') {
+                    $data{'offloadto'} = '';
+                    foreach my $key (keys(%{$offloadto})) {
+                        if (ref($offloadto->{$key}) eq 'ARRAY') {
+                            $data{'offloadto'} .= $key.'='.join(',',@{$offloadto->{$key}}).'&';
                         }
-                        $data{'offloadto'} =~ s/\&$//;
-                    } elsif (ref($offloadto) eq 'ARRAY') {
-                        $data{'offloadto'} = join(',',@{$offloadto});
                     }
+                    $data{'offloadto'} =~ s/\&$//;
+                } elsif (ref($offloadto) eq 'ARRAY') {
+                    $data{'offloadto'} = join(',',@{$offloadto});
                 }
             }
         }
@@ -577,11 +575,11 @@
         $udom=$data{'domain'};
     }
     if ($home eq 'no_host') { return &goto_login($r,$udom,\%data); }
-    if (&Apache::lonnet::hostname($home) eq '') { return &goto_login($r,$udom,\%data); } 
+    if (&Apache::lonnet::hostname($home) eq '') { return &goto_login($r,$udom,\%data); }
 
     my $rolemsg;
     if ($data{'role'}) {
-        $rolemsg = "role: $data{'role'}"; 
+        $rolemsg = "role: $data{'role'}";
     } else {
         $rolemsg = '(no role)';
     }




More information about the LON-CAPA-cvs mailing list