[LON-CAPA-cvs] cvs: loncom /cgi clusterstatus.pl

harris41 lon-capa-cvs@mail.lon-capa.org
Sat, 11 May 2002 21:29:42 -0000


harris41		Sat May 11 17:29:42 2002 EDT

  Modified files:              
    /loncom/cgi	clusterstatus.pl 
  Log:
  Using LONCAPA::Configuration::read_conf
  BUG 129
  
  
Index: loncom/cgi/clusterstatus.pl
diff -u loncom/cgi/clusterstatus.pl:1.2 loncom/cgi/clusterstatus.pl:1.3
--- loncom/cgi/clusterstatus.pl:1.2	Tue Feb 19 15:23:59 2002
+++ loncom/cgi/clusterstatus.pl	Sat May 11 17:29:42 2002
@@ -6,7 +6,11 @@
 # (Running loncron
 # 09/06/01 Gerd Kortemeyer)
 # 02/18/02,02/19/02 Gerd Kortemeyer)
-#
+# 5/11/2002 Scott Harrison
+
+use lib '/home/httpd/lib/perl/';
+use LONCAPA::Configuration;
+
 use LWP::UserAgent();
 use HTTP::Headers;
 use IO::File;
@@ -50,19 +54,12 @@
  
 print "Content-type: text/html\n\n".
       "<html><body bgcolor=#FFFFFF>\n";
-# ------------------------------------------------------------ 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
 
 # ------------------------------------------------------------- Read hosts file
 {