[LON-CAPA-cvs] cvs: loncom /cgi ping.pl
harris41
lon-capa-cvs@mail.lon-capa.org
Sat, 11 May 2002 21:31:41 -0000
harris41 Sat May 11 17:31:41 2002 EDT
Modified files:
/loncom/cgi ping.pl
Log:
Using LONCAPA::Configuration::read_conf
BUG 129
Index: loncom/cgi/ping.pl
diff -u loncom/cgi/ping.pl:1.1 loncom/cgi/ping.pl:1.2
--- loncom/cgi/ping.pl:1.1 Mon Feb 18 15:59:36 2002
+++ loncom/cgi/ping.pl Sat May 11 17:31:41 2002
@@ -6,6 +6,9 @@
$|=1;
+use lib '/home/httpd/lib/perl/';
+use LONCAPA::Configuration;
+
use IO::File;
use IO::Socket;
@@ -25,19 +28,12 @@
}
-# ------------------------------------------------------------ Read access.conf
-{
- my $config=IO::File->new("/etc/httpd/conf/access.conf");
-
- while (my $configline=<$config>) {
- if ($configline =~ /PerlSetVar/) {
- my ($dummy,$varname,$varvalue)=split(/\s+/,$configline);
- $perlvar{$varname}=$varvalue;
- }
- }
- delete $perlvar{'lonReceipt'}; # remove since sensitive and not needed
- delete $perlvar{'lonSqlAccess'}; # remove since sensitive and not needed
-}
+# ------------------------------------------- Read access.conf and loncapa.conf
+my $perlvarref=LONCAPA::Configuration::read_conf('access.conf','loncapa.conf');
+my %perlvar=%{$perlvarref};
+undef $perlvarref; # remove since sensitive and not needed
+delete $perlvar{'lonReceipt'}; # remove since sensitive and not needed
+delete $perlvar{'lonSqlAccess'}; # remove since sensitive and not needed
$testhost=$ENV{'QUERY_STRING'};
$testhost=~s/\W//g;