--- loncom/cgi/metadata_keywords.pl 2001/09/25 17:35:03 1.2 +++ loncom/cgi/metadata_keywords.pl 2002/05/11 21:31:00 1.3 @@ -7,6 +7,9 @@ # YEAR=2001 # 9/25 Scott Harrison # +# YEAR=2002 +# 5/11 Scott Harrison +# ############################################################################### ## ## @@ -26,7 +29,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 +45,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 +58,10 @@ 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); +my $perlvarref=LONCAPA::Configuration::read_conf('access.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;