r11719@llin: dpavlin | 2005-12-16 05:47:31 +0100
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 16 Dec 2005 01:47:20 +0000 (01:47 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 16 Dec 2005 01:47:20 +0000 (01:47 +0000)
 links now work [2.00_4]

git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@256 07558da8-63fa-0310-ba24-9fe276d99e06

TODO
lib/WebPAC.pm
lib/WebPAC/Output/Estraier.pm

diff --git a/TODO b/TODO
index 0e3683d..b43ff84 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,7 +1,7 @@
 + add multiple databases
 + support multiple inputs to single database [2.00_1]
 + lookups now works [2.00_3]
-- create links to other databases [2.00_4]
++ create links to other databases [2.00_4]
 - delete unused files in database directories
 - scoring for various fields in input/*.xml
 - write pure perl Search::HyperEstraier
index c0f6606..abab314 100644 (file)
@@ -13,7 +13,7 @@ Version 2.00
 
 =cut
 
-our $VERSION = '2.00_3';
+our $VERSION = '2.00_4';
 
 =head1 SYNOPSIS
 
index 1b2ced3..a3d1bc9 100644 (file)
@@ -349,17 +349,38 @@ priviledges
 
 =cut
 
+                                           
+
 sub est_ua {
        my $self = shift;
 
        return $self->{_master_ua} if ($self->{_master_ua});
 
-       $self->{_master_ua} = LWP::UserAgent->new( ) || sub {
+       {
+               package AdminUserAgent;
+               use base qw/LWP::UserAgent/;
+               sub new {
+                       my $self = LWP::UserAgent::new(@_);
+                       $self->agent("webpac/$VERSION");
+                       $self;
+               }
+               sub get_basic_credentials {
+                       my($self, $realm, $uri) = @_;
+                       return ($self->{user}, $self->{passwd});
+               }
+               sub set_basic_credentials {
+                       my ($self, $user, $passwd) = @_;
+                       $self->{user} = $user;
+                       $self->{passwd} = $passwd;
+               }
+       };
+
+       $self->{_master_ua} = AdminUserAgent->new( ) || sub {
                my $log = $self->_get_logger;
                $log->logdie("can't create LWP::UserAgent: $!");
        };
 
-       $self->{_master_ua}->credentials('localhost:1978','Super User', $self->{user} => $self->{passwd});
+       $self->{_master_ua}->set_basic_credentials($self->{user}, $self->{passwd});
 
        return $self->{_master_ua};
 }