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

raeburn raeburn@source.lon-capa.org
Wed, 10 Mar 2010 16:55:09 -0000


raeburn		Wed Mar 10 16:55:09 2010 EDT

  Modified files:              (Branch: version_2_9_X)
    /loncom/interface	loncommon.pm 
  Log:
  - Backport 1.946, 1.948 (part).
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.692.4.30 loncom/interface/loncommon.pm:1.692.4.31
--- loncom/interface/loncommon.pm:1.692.4.30	Thu Feb 25 15:52:23 2010
+++ loncom/interface/loncommon.pm	Wed Mar 10 16:55:08 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.692.4.30 2010/02/25 15:52:23 raeburn Exp $
+# $Id: loncommon.pm,v 1.692.4.31 2010/03/10 16:55:08 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4194,16 +4194,39 @@
     if (defined($cached)) { return %{$result}; }
 
     my %domconfig = &Apache::lonnet::get_dom('configuration',
-					     ['login','rolecolors'],$udom);
+					     ['login','rolecolors','loginvia'],$udom);
     my (%designhash,%legacy);
     if (keys(%domconfig) > 0) {
         if (ref($domconfig{'login'}) eq 'HASH') {
             if (keys(%{$domconfig{'login'}})) {
                 foreach my $key (keys(%{$domconfig{'login'}})) {
                     if (ref($domconfig{'login'}{$key}) eq 'HASH') {
-                        foreach my $img (keys(%{$domconfig{'login'}{$key}})) {
-                            $designhash{$udom.'.login.'.$key.'_'.$img} =
-                                $domconfig{'login'}{$key}{$img};
+                        if ($key eq 'loginvia') {
+                            if (ref($domconfig{'login'}{'loginvia'}) eq 'HASH') {
+                                my @ids = &Apache::lonnet::current_machine_ids();
+                                foreach my $hostname (@ids) {
+                                    if (ref($domconfig{'login'}{'loginvia'}{$hostname}) eq 'HASH') {
+                                        if ($domconfig{'login'}{'loginvia'}{$hostname}{'server'}) {
+                                            my $server = $domconfig{'login'}{'loginvia'}{$hostname}{'server'};
+                                            $designhash{$udom.'.login.loginvia'} = $server;
+                                            if ($domconfig{'login'}{'loginvia'}{$hostname}{'serverpath'} eq 'custom') {
+
+                                                $designhash{$udom.'.login.loginvia_'.$hostname} = $server.':'.$domconfig{'login'}{'loginvia'}{$hostname}{'custompath'};
+                                            } else {
+                                                 $designhash{$udom.'.login.loginvia_'.$hostname} = $server.':'.$domconfig{'login'}{'loginvia'}{$hostname}{'serverpath'};
+                                            }
+                                            if ($domconfig{'login'}{'loginvia'}{$hostname}{'exempt'}) {
+                                                $designhash{$udom.'.login.loginvia_exempt_'.$hostname} = $domconfig{'login'}{'loginvia'}{$hostname}{'exempt'};
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        } else {
+                            foreach my $img (keys(%{$domconfig{'login'}{$key}})) {
+                                $designhash{$udom.'.login.'.$key.'_'.$img} =
+                                    $domconfig{'login'}{$key}{$img};
+                            }
                         }
                     } else {
                         $designhash{$udom.'.login.'.$key}=$domconfig{'login'}{$key};