From 0072a3b7de2b681fca2c3d2277a4aeb17c737731 Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Sun, 11 Nov 2007 16:39:26 -0600 Subject: [PATCH] quick auth hack for zebra 2.0.18 could probably be cleaner... Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Context.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Context.pm b/C4/Context.pm index d6e269da32..dea785d5b3 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -487,7 +487,6 @@ sub Zconn { my $syntax=shift; if ( defined($context->{"Zconn"}->{$server}) ) { return $context->{"Zconn"}->{$server}; - # No connection object or it died. Create one. }else { $context->{"Zconn"}->{$server} = &_new_Zconn($server,$async,$auth,$piggyback,$syntax); @@ -518,21 +517,22 @@ sub _new_Zconn { $syntax = "usmarc" unless $syntax; my $host = $context->{'listen'}->{$server}->{'content'}; - my $user = $context->{"serverinfo"}->{$server}->{"user"}; my $servername = $context->{"config"}->{$server}; + my $user = $context->{"serverinfo"}->{$server}->{"user"}; my $password = $context->{"serverinfo"}->{$server}->{"password"}; + $auth = 1 if($user && $password); retry: eval { # set options my $o = new ZOOM::Options(); + $o->option(user=>$user) if $auth; + $o->option(password=>$password) if $auth; $o->option(async => 1) if $async; $o->option(count => $piggyback) if $piggyback; $o->option(cqlfile=> $context->{"server"}->{$server}->{"cql2rpn"}); $o->option(cclfile=> $context->{"serverinfo"}->{$server}->{"ccl2rpn"}); $o->option(preferredRecordSyntax => $syntax); $o->option(elementSetName => "F"); # F for 'full' as opposed to B for 'brief' - $o->option(user=>$user) if $auth; - $o->option(password=>$password) if $auth; $o->option(databaseName => ($servername?$servername:"biblios")); # create a new connection object -- 2.39.5