--- loncom/metadata_database/searchcat.pl 2002/03/04 05:06:18 1.16 +++ loncom/metadata_database/searchcat.pl 2002/05/11 21:28:20 1.17 @@ -2,7 +2,7 @@ # The LearningOnline Network # searchcat.pl "Search Catalog" batch script # -# $Id: searchcat.pl,v 1.16 2002/03/04 05:06:18 harris41 Exp $ +# $Id: searchcat.pl,v 1.17 2002/05/11 21:28:20 harris41 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -27,15 +27,20 @@ # http://www.lon-capa.org/ # # YEAR=2001 -# # 04/14/2001, 04/16/2001 Scott Harrison # +# YEAR=2002 +# 05/11/2002 Scott Harrison +# ### # This script goes through a LON-CAPA resource # directory and gathers metadata. # The metadata is entered into a SQL database. +use lib '/home/httpd/lib/perl/'; +use LONCAPA::Configuration; + use IO::File; use HTML::TokeParser; use DBI; @@ -50,17 +55,11 @@ sub wanted { push(@metalist,"$dir/$_"); } -# ------------------------------------ Read httpd access.conf and get variables -open (CONFIG,"/etc/httpd/conf/access.conf") || die "Can't read access.conf"; - -while ($configline=) { - if ($configline =~ /PerlSetVar/) { - my ($dummy,$varname,$varvalue)=split(/\s+/,$configline); - chomp($varvalue); - $perlvar{$varname}=$varvalue; - } -} -close(CONFIG); +# ------------------------- Read access.conf and loncapa.conf and get variables +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 # ------------------------------------- Only run if machine is a library server exit unless $perlvar{'lonRole'} eq 'library';