Diff for /loncom/cgi/metadata_keywords.pl between versions 1.1 and 1.3

version 1.1, 2001/09/25 17:30:00 version 1.3, 2002/05/11 21:31:00
Line 7 Line 7
 # YEAR=2001  # YEAR=2001
 # 9/25 Scott Harrison  # 9/25 Scott Harrison
 #  #
   # YEAR=2002
   # 5/11 Scott Harrison
   #
   
 ###############################################################################  ###############################################################################
 ##                                                                           ##  ##                                                                           ##
Line 26 Line 29
 # 1=horrible 2=poor 3=fair 4=good 5=excellent  # 1=horrible 2=poor 3=fair 4=good 5=excellent
 # Organization 5  # Organization 5
 # Functionality 4  # Functionality 4
 # Has it been tested? 3  # Has it been tested? 4
 #  #
   
 # ------------------------------------------ Purpose and description of program  # ------------------------------------------ Purpose and description of program
Line 42 Line 45
 # should reflect this information) instead.  This is a speedier approach.  # should reflect this information) instead.  This is a speedier approach.
   
 # ------------------------------------------------- Modules used by this script  # ------------------------------------------------- Modules used by this script
   
   use lib '/home/httpd/lib/perl/';
   use LONCAPA::Configuration;
   
 use strict;  use strict;
 use DBI;  use DBI;
   
Line 51  print 'Content-type: text/plain'."\n\n"; Line 58  print 'Content-type: text/plain'."\n\n";
   
 # --- Make sure that database can be accessed and that this is a library server  # --- Make sure that database can be accessed and that this is a library server
 # library server test  # library server test
 my %perlvar;  my $perlvarref=LONCAPA::Configuration::read_conf('access.conf','loncapa.conf');
 open (CONFIG,"/etc/httpd/conf/access.conf") ||   my %perlvar=%{$perlvarref};
     (print "Can't read access.conf\n" && exit);  undef($perlvarref);
 while (my $configline=<CONFIG>) {  
     if ($configline =~ /PerlSetVar/) {  
  my ($dummy,$varname,$varvalue)=split(/\s+/,$configline);  
         chomp($varvalue);  
         $perlvar{$varname}=$varvalue;  
     }  
 }  
 close(CONFIG);  
 unless ($perlvar{'lonRole'} eq 'library') {  unless ($perlvar{'lonRole'} eq 'library') {
     print "This can only be run on a library server!\n";      print "This can only be run on a library server!\n";
     exit;      exit;
Line 80  my $dbh; Line 80  my $dbh;
 }  }
 %perlvar=(); # undefine it  %perlvar=(); # undefine it
   
 print "testmsg\n";  
 # ------------------------ Loop through database records and print out keywords  # ------------------------ Loop through database records and print out keywords
 my $sth=$dbh->prepare("select * from metadata");  my $sth=$dbh->prepare("select * from metadata");
 $sth->execute();  $sth->execute();
 my @row;  my @row;
 while (@row=$sth->fetchrow_array) {  while (@row=$sth->fetchrow_array) {
     print 'ROW:'.$row[4]."\n";      print $row[4]."\n";
 }  }
   
 # --------------------------------------------------- Close database connection  # --------------------------------------------------- Close database connection

Removed from v.1.1  
changed lines
  Added in v.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>