[LON-CAPA-cvs] cvs: loncom /auth lonlogout.pm /lonnet/perl lonnet.pm

raeburn raeburn at source.lon-capa.org
Sun Jan 8 18:24:08 EST 2012


raeburn		Sun Jan  8 23:24:08 2012 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
    /loncom/auth	lonlogout.pm 
  Log:
  For users for whom homeserver is a multi-domain server:
  - "Log-in again" link, where there is neither a domain portal defined
    nor a redirect to a lonBalancer, lacked a query string (with domain)
    appended to /adm/login, where user's domain is not default domain for
    the server in the link URL.
  - Additional item ($isredirect) returned from lonnet::choose_server().
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1150 loncom/lonnet/perl/lonnet.pm:1.1151
--- loncom/lonnet/perl/lonnet.pm:1.1150	Tue Dec 20 22:40:06 2011
+++ loncom/lonnet/perl/lonnet.pm	Sun Jan  8 23:23:58 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1150 2011/12/20 22:40:06 raeburn Exp $
+# $Id: lonnet.pm,v 1.1151 2012/01/08 23:23:58 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -930,7 +930,7 @@
     my %domconfhash = &Apache::loncommon::get_domainconf($udom);
     my %servers = &get_servers($udom);
     my $lowest_load = 30000;
-    my ($login_host,$hostname,$portal_path);
+    my ($login_host,$hostname,$portal_path,$isredirect);
     foreach my $lonhost (keys(%servers)) {
         my $loginvia;
         if ($checkloginvia) {
@@ -941,12 +941,14 @@
                     &compare_server_load($server, $login_host, $lowest_load);
                 if ($login_host eq $server) {
                     $portal_path = $path;
+                    $isredirect = 1;
                 }
             } else {
                 ($login_host, $lowest_load) =
                     &compare_server_load($lonhost, $login_host, $lowest_load);
                 if ($login_host eq $lonhost) {
                     $portal_path = '';
+                    $isredirect = ''; 
                 }
             }
         } else {
@@ -957,7 +959,7 @@
     if ($login_host ne '') {
         $hostname = &hostname($login_host);
     }
-    return ($login_host,$hostname,$portal_path);
+    return ($login_host,$hostname,$portal_path,$isredirect);
 }
 
 # --------------------------------------------- Try to change a user's password
Index: loncom/auth/lonlogout.pm
diff -u loncom/auth/lonlogout.pm:1.43 loncom/auth/lonlogout.pm:1.44
--- loncom/auth/lonlogout.pm:1.43	Sat Oct 22 23:53:46 2011
+++ loncom/auth/lonlogout.pm	Sun Jan  8 23:24:08 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Logout Handler
 #
-# $Id: lonlogout.pm,v 1.43 2011/10/22 23:53:46 raeburn Exp $
+# $Id: lonlogout.pm,v 1.44 2012/01/08 23:24:08 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -117,11 +117,21 @@
                      $login_url = $domdefaults{'portal_def'};
                  } else {
                      my $checkloginvia = 1;
-                     my ($lonhost,$server,$path) = 
+                     my ($lonhost,$server,$path,$isredirect) = 
                          &Apache::lonnet::choose_server($domain,$checkloginvia);
                      if ($server && $lonhost) {
                          $login_url = $Apache::lonnet::protocol{$lonhost}.
                                       '://'.$server.$path;
+                         if (($path eq '') && (!$isredirect)) {
+                             my $serverhomeID =
+                                 &Apache::lonnet::get_server_homeID($lonhost);
+                             my $serverhomedom =
+                                 &Apache::lonnet::host_domain($serverhomeID);
+                             if ($serverhomedom ne $domain) {
+                                 $path = '/adm/login';
+                                 $login_url .= $path;
+                             }
+                         }
                          if ($path eq '/adm/login' && $domain ne '') {
                              $login_url .= '?domain='.$domain;
                          }




More information about the LON-CAPA-cvs mailing list