--- loncom/lond 2011/07/28 15:12:03 1.476 +++ loncom/lond 2011/07/31 22:55:48 1.477 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.476 2011/07/28 15:12:03 raeburn Exp $ +# $Id: lond,v 1.477 2011/07/31 22:55:48 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -60,7 +60,7 @@ my $DEBUG = 0; # Non zero to ena my $status=''; my $lastlog=''; -my $VERSION='$Revision: 1.476 $'; #' stupid emacs +my $VERSION='$Revision: 1.477 $'; #' stupid emacs my $remoteVERSION; my $currenthostid="default"; my $currentdomainid; @@ -1641,6 +1641,35 @@ sub ls3_handler { } ®ister_handler("ls3", \&ls3_handler, 0, 1, 0); +sub read_lonnet_global { + my ($cmd,$tail,$client) = @_; + my $userinput = "$cmd:$tail"; + my $requested = &Apache::lonnet::thaw_unescape($tail); + my $result; + if (ref($requested) eq 'HASH') { + foreach my $what (keys(%{$requested})) { + my $type = $requested->{$what}; + my $lonnetglobal = 'Apache::lonnet::'.$what; + my $response; + if ($type eq 'HASH') { + if (defined(%{$lonnetglobal})) { + my $hashref = \%{$lonnetglobal}; + $response = &Apache::lonnet::freeze_escape($hashref); + } + } else { + if (defined(${$lonnetglobal})) { + $response = &escape(${$item}); + } + } + } + $result .= &escape($what).'='.$response.'&'; + } + $result =~ s/\&$//; + &Reply($client,\$result,$userinput); + return 1; +} +®ister_handler("readlonnetglobal", \&read_lonnet_global, 0, 1, 0); + sub server_timezone_handler { my ($cmd,$tail,$client) = @_; my $userinput = "$cmd:$tail";