[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm
raeburn
raeburn@source.lon-capa.org
Wed, 03 Mar 2010 16:54:03 -0000
raeburn Wed Mar 3 16:54:03 2010 EDT
Modified files:
/loncom/interface loncommon.pm
Log:
- Setting domain config in &get_domainconf().
- For loginvia item in login hash is now a hash of a hash.
outer key is lonHostID, inner keys are: server, serverpath, custompath, exempt.
- Construct corrensponding items in (cached) %designhash:
$designhash{$udom.'.login.loginvia_'.$hostname}
$designhash{$udom.'.login.loginvia_exempt_'.$hostname}
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.945 loncom/interface/loncommon.pm:1.946
--- loncom/interface/loncommon.pm:1.945 Sun Feb 28 22:56:23 2010
+++ loncom/interface/loncommon.pm Wed Mar 3 16:54:03 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.945 2010/02/28 22:56:23 raeburn Exp $
+# $Id: loncommon.pm,v 1.946 2010/03/03 16:54:03 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -4238,9 +4238,30 @@
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 ($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};