--- loncom/cgi/metadata_keywords.pl 2001/09/25 17:35:03 1.2 +++ loncom/cgi/metadata_keywords.pl 2003/02/03 18:03:52 1.5 @@ -5,7 +5,8 @@ # Gets keywords from metadata database. # # YEAR=2001 -# 9/25 Scott Harrison +# +# YEAR=2002 # ############################################################################### @@ -26,7 +27,7 @@ # 1=horrible 2=poor 3=fair 4=good 5=excellent # Organization 5 # Functionality 4 -# Has it been tested? 3 +# Has it been tested? 4 # # ------------------------------------------ Purpose and description of program @@ -42,6 +43,10 @@ # should reflect this information) instead. This is a speedier approach. # ------------------------------------------------- Modules used by this script + +use lib '/home/httpd/lib/perl/'; +use LONCAPA::Configuration; + use strict; use DBI; @@ -51,17 +56,12 @@ print 'Content-type: text/plain'."\n\n"; # --- Make sure that database can be accessed and that this is a library server # library server test -my %perlvar; -open (CONFIG,"/etc/httpd/conf/access.conf") || - (print "Can't read access.conf\n" && exit); -while (my $configline=) { - if ($configline =~ /PerlSetVar/) { - my ($dummy,$varname,$varvalue)=split(/\s+/,$configline); - chomp($varvalue); - $perlvar{$varname}=$varvalue; - } -} -close(CONFIG); + +# By default, loncapa_apache.conf is also read by the read_conf subroutine. +my $perlvarref=LONCAPA::Configuration::read_conf('loncapa.conf'); +my %perlvar=%{$perlvarref}; +undef($perlvarref); + unless ($perlvar{'lonRole'} eq 'library') { print "This can only be run on a library server!\n"; exit;