version 1.16, 2002/03/04 05:06:18
|
version 1.17, 2002/05/11 21:28:20
|
Line 27
|
Line 27
|
# http://www.lon-capa.org/ |
# http://www.lon-capa.org/ |
# |
# |
# YEAR=2001 |
# YEAR=2001 |
# |
|
# 04/14/2001, 04/16/2001 Scott Harrison |
# 04/14/2001, 04/16/2001 Scott Harrison |
# |
# |
|
# YEAR=2002 |
|
# 05/11/2002 Scott Harrison |
|
# |
### |
### |
|
|
# This script goes through a LON-CAPA resource |
# This script goes through a LON-CAPA resource |
# directory and gathers metadata. |
# directory and gathers metadata. |
# The metadata is entered into a SQL database. |
# The metadata is entered into a SQL database. |
|
|
|
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA::Configuration; |
|
|
use IO::File; |
use IO::File; |
use HTML::TokeParser; |
use HTML::TokeParser; |
use DBI; |
use DBI; |
Line 50 sub wanted {
|
Line 55 sub wanted {
|
push(@metalist,"$dir/$_"); |
push(@metalist,"$dir/$_"); |
} |
} |
|
|
# ------------------------------------ Read httpd access.conf and get variables |
# ------------------------- Read access.conf and loncapa.conf and get variables |
open (CONFIG,"/etc/httpd/conf/access.conf") || die "Can't read access.conf"; |
my $perlvarref=LONCAPA::Configuration::read_conf('access.conf','loncapa.conf'); |
|
my %perlvar=%{$perlvarref}; |
while ($configline=<CONFIG>) { |
undef $perlvarref; # remove since sensitive and not needed |
if ($configline =~ /PerlSetVar/) { |
delete $perlvar{'lonReceipt'}; # remove since sensitive and not needed |
my ($dummy,$varname,$varvalue)=split(/\s+/,$configline); |
|
chomp($varvalue); |
|
$perlvar{$varname}=$varvalue; |
|
} |
|
} |
|
close(CONFIG); |
|
|
|
# ------------------------------------- Only run if machine is a library server |
# ------------------------------------- Only run if machine is a library server |
exit unless $perlvar{'lonRole'} eq 'library'; |
exit unless $perlvar{'lonRole'} eq 'library'; |