--- loncom/interface/lonindexer.pm 2003/02/20 19:41:26 1.61 +++ loncom/interface/lonindexer.pm 2003/07/22 19:00:51 1.71 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.61 2003/02/20 19:41:26 www Exp $ +# $Id: lonindexer.pm,v 1.71 2003/07/22 19:00:51 ng Exp $ # # Copyright Michigan State University Board of Trustees # @@ -62,6 +62,7 @@ use strict; use Apache::lonnet(); use Apache::loncommon(); use Apache::Constants qw(:common); +use Apache::lonmeta; use Apache::File; use GDBM_File; @@ -84,13 +85,13 @@ my @Omit = (); # ----------------------------- Handling routine called via Apache and mod_perl sub handler { my $r = shift; + my $c = $r->connection(); $r->content_type('text/html'); &Apache::loncommon::no_cache($r); $r->send_http_header; return OK if $r->header_only; $fnum=0; $dnum=0; - untie %hash; # Deal with stupid global variables (is there a way around making # these global to this package? It is just so wrong....) @@ -124,9 +125,18 @@ sub handler { $extrafield=''; my $diropendb = - "/home/httpd/perl/tmp/$domain\_$ENV{'user.name'}_indexer.db"; - - if (tie(%hash,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) { + "/home/httpd/perl/tmp/$ENV{'user.domain'}_$ENV{'user.name'}_indexer.db"; + %hash = (); + { + my %dbfile; + if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) { + while(my($key,$value)=each(%dbfile)) { + $hash{$key}=$value; + } + untie(%dbfile); + } + } + { if ($ENV{'form.launch'} eq '1') { &start_fresh_session(); } @@ -309,10 +319,14 @@ END