[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface loncommon.pm

raeburn raeburn at source.lon-capa.org
Thu Jan 28 21:42:15 EST 2021


raeburn		Fri Jan 29 02:42:15 2021 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	loncommon.pm 
  Log:
  - For 2.11
    Backport 1.1352, 1.1353
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1075.2.150 loncom/interface/loncommon.pm:1.1075.2.151
--- loncom/interface/loncommon.pm:1.1075.2.150	Mon Jan  4 03:42:19 2021
+++ loncom/interface/loncommon.pm	Fri Jan 29 02:42:15 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1075.2.150 2021/01/04 03:42:19 raeburn Exp $
+# $Id: loncommon.pm,v 1.1075.2.151 2021/01/29 02:42:15 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -7993,10 +7993,17 @@
                 unless (&Apache::lonnet::allowed('mau',$dom_in_use)) {
                     my %domdefs = &Apache::lonnet::get_domain_defaults($dom_in_use);
                     my $lonhost = $Apache::lonnet::perlvar{'lonHostID'};
-                    my $offload;
+                    my ($offload,$offloadoth);
                     if (ref($domdefs{'offloadnow'}) eq 'HASH') {
                         if ($domdefs{'offloadnow'}{$lonhost}) {
                             $offload = 1;
+                            if (($env{'user.domain'} ne '') && ($env{'user.domain'} ne $dom_in_use) &&
+                                (!(($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')))) {
+                                unless (&Apache::lonnet::shared_institution($env{'user.domain'})) {
+                                    $offloadoth = 1;
+                                    $dom_in_use = $env{'user.domain'};
+                                }
+                            }
                         }
                     }
                     unless ($offload) {
@@ -8006,6 +8013,7 @@
                                     (!(($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')))) {
                                     unless (&Apache::lonnet::shared_institution($env{'user.domain'})) {
                                         $offload = 1;
+                                        $offloadoth = 1;
                                         $dom_in_use = $env{'user.domain'};
                                     }
                                 }
@@ -8014,6 +8022,12 @@
                     }
                     if ($offload) {
                         my $newserver = &Apache::lonnet::spareserver(30000,undef,1,$dom_in_use);
+                        if (($newserver eq '') && ($offloadoth)) {
+                            my @domains = &Apache::lonnet::current_machine_domains();
+                            if (($dom_in_use ne '') && (!grep(/^\Q$dom_in_use\E$/, at domains))) { 
+                                ($newserver) = &Apache::lonnet::choose_server($dom_in_use);
+                            }
+                        }
                         if (($newserver) && ($newserver ne $lonhost)) {
                             my $numsec = 5;
                             my $timeout = $numsec * 1000;




More information about the LON-CAPA-cvs mailing list