--- loncom/LondConnection.pm 2003/10/28 10:47:44 1.14 +++ loncom/LondConnection.pm 2003/10/28 11:15:10 1.15 @@ -1,7 +1,7 @@ # This module defines and implements a class that represents # a connection to a lond daemon. # -# $Id: LondConnection.pm,v 1.14 2003/10/28 10:47:44 foxr Exp $ +# $Id: LondConnection.pm,v 1.15 2003/10/28 11:15:10 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -64,10 +64,33 @@ sub ReadConfig { die "Can't read host table!!"; %hostshash = %{$hoststab}; - close(CONFIG); } +# +# Read a foreign configuration. +# This sub is intended for the cases where the package +# will be read from outside the LonCAPA environment, in that case +# the client will need to explicitly provide: +# - A file in hosts.tab format. +# - Some idea of the 'lonCAPA' name of the local host (for building +# the encryption key). +# +# Parameters: +# MyHost - Name of this host as far as LonCAPA is concerned. +# Filename - Name of a hosts.tab formatted file that will be used +# to build up the hosts table. +# +sub ReadForeignConfig { + my $MyHost = shift; + my $Filename = shift; + + $perlvar{lonHostID} = $MyHost; # Rmember my host. + my $hosttab = read_hosts($Filename) || + die "Can't read hosts table!!"; + %hostshash = %{$hosttab} + +} sub Debug { my $level = shift;