--- loncom/interface/lonindexer.pm 2006/05/31 16:22:10 1.143 +++ loncom/interface/lonindexer.pm 2007/06/27 16:35:55 1.161 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.143 2006/05/31 16:22:10 www Exp $ +# $Id: lonindexer.pm,v 1.161 2007/06/27 16:35:55 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -54,6 +54,7 @@ use Apache::File; use Apache::lonlocal; use Apache::lonsource(); use GDBM_File; +use LONCAPA qw(:match); # ---------------------------------------- variables used throughout the module my %hash; # global user-specific gdbm file @@ -119,11 +120,15 @@ sub handler { $extrafield=''; my $diropendb = - "/home/httpd/perl/tmp/$env{'user.domain'}_$env{'user.name'}_indexer.db"; + "/home/httpd/perl/tmp/$env{'user.domain'}_$env{'user.name'}_sel_res.db"; %hash = (); { my %dbfile; - if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_READER(),0640)) { + if (tie(%dbfile,'GDBM_File',$diropendb,&GDBM_WRITER(),0640)) { + if ($env{'form.launch'} eq '1') { + &start_fresh_session(\%dbfile); + } + while(my($key,$value)=each(%dbfile)) { $hash{$key}=$value; } @@ -131,9 +136,6 @@ sub handler { } } { - if ($env{'form.launch'} eq '1') { - &start_fresh_session(); - } #Hijack lonindexer to verify a title and be close down. if ($env{'form.launch'} eq '2') { &Apache::loncommon::content_type($r,'text/html'); @@ -171,7 +173,7 @@ ENDSUBM # --------------------- define extra fields and buttons in case of special mode if ($env{'form.catalogmode'} eq 'interactive') { $extrafield='