version 1.862, 2007/04/04 00:07:07
|
version 1.863, 2007/04/04 00:10:15
|
Line 671 sub homeserver {
|
Line 671 sub homeserver {
|
return 'no_host'; |
return 'no_host'; |
} |
} |
|
|
# ---------------------- Get domain configuration for a domain |
|
sub get_domainconf { |
|
my ($udom) = @_; |
|
my $cachetime=1800; |
|
my ($result,$cached)=&is_cached_new('domainconfig',$udom); |
|
if (defined($cached)) { return %{$result}; } |
|
|
|
if ($udom eq '') { |
|
$udom = &Apache::loncommon::determinedomain(); |
|
} |
|
my %domconfig = &get_dom('configuration',['login','rolecolors'],$udom); |
|
my %designhash; |
|
if (keys(%domconfig) > 0) { |
|
if (ref($domconfig{'login'}) eq 'HASH') { |
|
foreach my $key (keys(%{$domconfig{'login'}})) { |
|
$designhash{$udom.'.login.'.$key}=$domconfig{'login'}{$key}; |
|
} |
|
} |
|
if (ref($domconfig{'rolecolors'}) eq 'HASH') { |
|
foreach my $role (keys(%{$domconfig{'rolecolors'}})) { |
|
if (ref($domconfig{'rolecolors'}{$role}) eq 'HASH') { |
|
foreach my $item (keys(%{$domconfig{'rolecolors'}{$role}})) { |
|
$designhash{$udom.'.'.$role.'.'.$item}=$domconfig{'rolecolors'}{$role}{$item}; |
|
} |
|
} |
|
} |
|
} |
|
} else { |
|
my $designdir=$perlvar{'lonTabDir'}.'/lonDomColors'; |
|
my $designfile = $designdir.'/'.$udom.'.tab'; |
|
if (-e $designfile) { |
|
if ( open (my $fh,"<$designfile") ) { |
|
while (my $line = <$fh>) { |
|
next if ($line =~ /^\#/); |
|
chomp($line); |
|
my ($key,$val)=(split(/\=/,$line)); |
|
if ($val) { $designhash{$udom.'.'.$key}=$val; } |
|
} |
|
close($fh); |
|
} |
|
} |
|
if (-e '/home/httpd/html/adm/lonDomLogos/'.$udom.'.gif') { |
|
$designhash{$udom.'.login.domlogo'} = |
|
&lonhttpdurl("/adm/lonDomLogos/$udom.gif"); |
|
} |
|
} |
|
&do_cache_new('domainconfig',$udom,\%designhash,$cachetime); |
|
return %designhash; |
|
} |
|
|
|
sub devalidate_domconfig_cache { |
|
my ($udom)=@_; |
|
&devalidate_cache_new('domainconfig',$udom); |
|
} |
|
|
|
# ------------------------------------- Find the usernames behind a list of IDs |
# ------------------------------------- Find the usernames behind a list of IDs |
|
|
sub idget { |
sub idget { |