version 1.1056.4.23, 2011/03/04 02:06:36
|
version 1.1056.4.25, 2011/05/14 17:16:49
|
Line 196 sub get_server_timezone {
|
Line 196 sub get_server_timezone {
|
} |
} |
} |
} |
|
|
|
sub get_server_distarch { |
|
my ($lonhost,$ignore_cache) = @_; |
|
if (defined($lonhost)) { |
|
if (!defined(&hostname($lonhost))) { |
|
return; |
|
} |
|
my $cachetime = 12*3600; |
|
if (!$ignore_cache) { |
|
my ($distarch,$cached)=&is_cached_new('serverdistarch',$lonhost); |
|
if (defined($cached)) { |
|
return $distarch; |
|
} |
|
} |
|
my $rep = &reply('serverdistarch',$lonhost); |
|
unless ($rep eq 'unknown_command' || $rep eq 'no_such_host' || |
|
$rep eq 'con_lost' || $rep eq 'rejected' || $rep eq 'refused' || |
|
$rep eq '') { |
|
return &do_cache_new('serverdistarch',$lonhost,$rep,$cachetime); |
|
} |
|
} |
|
return; |
|
} |
|
|
sub get_server_loncaparev { |
sub get_server_loncaparev { |
my ($dom,$lonhost,$ignore_cache,$caller) = @_; |
my ($dom,$lonhost,$ignore_cache,$caller) = @_; |
if (defined($lonhost)) { |
if (defined($lonhost)) { |
Line 7350 sub store_userdata {
|
Line 7373 sub store_userdata {
|
$namevalue.=&escape($key).'='.&freeze_escape($$storehash{$key}).'&'; |
$namevalue.=&escape($key).'='.&freeze_escape($$storehash{$key}).'&'; |
} |
} |
$namevalue=~s/\&$//; |
$namevalue=~s/\&$//; |
$result = &reply("store:$env{'user.domain'}:$env{'user.name'}:". |
$result = &reply("store:$udom:$uname:$namespace:$datakey:". |
"$namespace:$datakey:$namevalue",$uhome); |
$namevalue,$uhome); |
} |
} |
} else { |
} else { |
$result = 'error: data to store was not a hash reference'; |
$result = 'error: data to store was not a hash reference'; |
Line 10062 sub get_dns {
|
Line 10085 sub get_dns {
|
my $loaded; |
my $loaded; |
my %name_to_host; |
my %name_to_host; |
my %internetdom; |
my %internetdom; |
|
my %LC_dns_serv; |
|
|
sub parse_hosts_tab { |
sub parse_hosts_tab { |
my ($file) = @_; |
my ($file) = @_; |
foreach my $configline (@$file) { |
foreach my $configline (@$file) { |
next if ($configline =~ /^(\#|\s*$ )/x); |
next if ($configline =~ /^(\#|\s*$ )/x); |
next if ($configline =~ /^\^/); |
chomp($configline); |
chomp($configline); |
if ($configline =~ /^\^/) { |
|
if ($configline =~ /^\^([\w.\-]+)/) { |
|
$LC_dns_serv{$1} = 1; |
|
} |
|
next; |
|
} |
my ($id,$domain,$role,$name,$protocol,$intdom)=split(/:/,$configline); |
my ($id,$domain,$role,$name,$protocol,$intdom)=split(/:/,$configline); |
$name=~s/\s//g; |
$name=~s/\s//g; |
if ($id && $domain && $role && $name) { |
if ($id && $domain && $role && $name) { |