/[webpac2]/trunk/lib/WebPAC/Output/Estraier.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Output/Estraier.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 255 by dpavlin, Fri Dec 16 01:04:20 2005 UTC revision 284 by dpavlin, Sun Dec 18 16:22:58 2005 UTC
# Line 17  WebPAC::Output::Estraier - Create Hyper Line 17  WebPAC::Output::Estraier - Create Hyper
17    
18  =head1 VERSION  =head1 VERSION
19    
20  Version 0.05  Version 0.06
21    
22  =cut  =cut
23    
24  our $VERSION = '0.05';  our $VERSION = '0.06';
25    
26  =head1 SYNOPSIS  =head1 SYNOPSIS
27    
# Line 239  sub master { Line 239  sub master {
239                  validate => 'master',                  validate => 'master',
240                  rest_url => $self->{masterurl} . '/master?action=' . $action ,                  rest_url => $self->{masterurl} . '/master?action=' . $action ,
241                  action => $action,                  action => $action,
242                    %{ $args },
243          );          );
244  }  }
245    
# Line 322  sub estcall { Line 323  sub estcall {
323                  $del = '&';                  $del = '&';
324          }          }
325    
326          $url_args =~ s#^\&#?# if ($url =~ m#\?#);          $url .= $url_args if ($url_args);
         $url .= $url_args;  
327    
328          $log->debug("calling $url");          $log->debug("calling $url");
329    
# Line 349  priviledges Line 349  priviledges
349    
350  =cut  =cut
351    
352                                                
353    
354  sub est_ua {  sub est_ua {
355          my $self = shift;          my $self = shift;
356    
357          return $self->{_master_ua} if ($self->{_master_ua});          return $self->{_master_ua} if ($self->{_master_ua});
358    
359          $self->{_master_ua} = LWP::UserAgent->new( ) || sub {          {
360                    package AdminUserAgent;
361                    use base qw/LWP::UserAgent/;
362                    sub new {
363                            my $self = LWP::UserAgent::new(@_);
364                            $self->agent("webpac/$VERSION");
365                            $self;
366                    }
367                    sub get_basic_credentials {
368                            my($self, $realm, $uri) = @_;
369                            return ($self->{user}, $self->{passwd});
370                    }
371                    sub set_basic_credentials {
372                            my ($self, $user, $passwd) = @_;
373                            $self->{user} = $user;
374                            $self->{passwd} = $passwd;
375                    }
376            };
377    
378            $self->{_master_ua} = AdminUserAgent->new( ) || sub {
379                  my $log = $self->_get_logger;                  my $log = $self->_get_logger;
380                  $log->logdie("can't create LWP::UserAgent: $!");                  $log->logdie("can't create LWP::UserAgent: $!");
381          };          };
382    
383          $self->{_master_ua}->credentials('localhost:1978','Super User', $self->{user} => $self->{passwd});          $self->{_master_ua}->set_basic_credentials($self->{user}, $self->{passwd});
384    
385          return $self->{_master_ua};          return $self->{_master_ua};
386  }  }

Legend:
Removed from v.255  
changed lines
  Added in v.284

  ViewVC Help
Powered by ViewVC 1.1.26