OpenILS::Utils::Cronscript can have only 1 session.
authorJason Stephenson <jstephenson@mvlc.org>
Mon, 31 Oct 2011 20:36:27 +0000 (16:36 -0400)
committerDan Scott <dscott@laurentian.ca>
Mon, 31 Oct 2011 20:45:29 +0000 (16:45 -0400)
Work around the above limitation by using OpenSRF::AppSession
to create a session for open-ils.auth in the authenticate method.

Also requires us to manually check if we're bootstrapped, since
we can't rely on OpenILS::Utils::Cronscript->session to do it for
us.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/perlmods/lib/OpenILS/Utils/Cronscript.pm.in

index 9e5e8e5..cb0c860 100644 (file)
@@ -300,7 +300,8 @@ sub authenticate {
     my $self = shift or return;
     my $args = shift or return;
     if ($args && ref($args) eq 'HASH') {
-        my $session = $self->session('open-ils.auth');
+        $self->{bootstrapped}  or $self->bootstrap();
+        my $session = Opensrf::AppSession->create('open-ils.auth');
         my $seed = $session->request('open-ils.auth.authenticate.init',
                                     $args->{'username'})->gather(1);
         $args->{password} = md5_hex($seed . md5_hex($args->{password}));