From a4cf545448356a6fa031e479fa021e7376eb66f2 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 12 Oct 2020 12:38:14 -0400 Subject: [PATCH] sip2 activity;repairs Signed-off-by: Bill Erickson --- Open-ILS/examples/fm_IDL.xml | 3 ++- Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2.pm | 2 +- Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2/Patron.pm | 4 ++++ Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2/Session.pm | 6 +++--- Open-ILS/src/sql/Pg/upgrade/XXXX.schema.sip-config.sql | 7 ++++++- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 1913159726..7236968371 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -13492,6 +13492,7 @@ SELECT usr, + @@ -13511,7 +13512,7 @@ SELECT usr, oils_obj:fieldmapper="sip::session" oils_persist:tablename="sip.session" reporter:label="SIP Session"> - + diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2.pm index d39d91c595..799bd8abd0 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2.pm @@ -52,7 +52,7 @@ sub dispatch_sip2_request { # A cached session means we have successfully logged in with # the SIP credentials provided during a login request. All # message types following require authentication. - my $session = OpenILS::Application::SIPSession->from_cache($seskey); + my $session = OpenILS::Application::SIPSession->find($seskey); return OpenILS::Event->new('SIP2_SESSION_REQUIRED') unless $session; my $MESSAGE_MAP = { diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2/Patron.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2/Patron.pm index 847d0150af..2d711a0c41 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2/Patron.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2/Patron.pm @@ -63,6 +63,10 @@ sub get_patron_details { set_patron_summary_items($session, $details, %params); set_patron_summary_list_items($session, $details, %params); + $U->log_user_activity($patron->id, + $session->sip_account->activity_who || $session->config->{default_activity_who}, + 'verify'); + return $details; } diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2/Session.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2/Session.pm index 60b6461216..4067a606af 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2/Session.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2/Session.pm @@ -71,7 +71,7 @@ sub find { $seskey, {flesh => 1, flesh_fields => {sipses => ['account']}}]); if ($ses) { - $session->sip_account($ses->account); + $session->{sip_account} = $ses->account; $e->authtoken($ses->ils_token); @@ -134,14 +134,14 @@ sub set_ils_account { # Ephemeral account sessions are not tracked in the database return 1 if $U->is_true($self->sip_account->ephemeral); - my $ses = Fieldmapper::sip::account->new; + my $ses = Fieldmapper::sip::session->new; $ses->key($seskey); $ses->ils_token($auth->{payload}->{authtoken}); $ses->account($self->sip_account->id); $e->xact_begin; unless ($e->create_sip_session($ses)) { - $e->rolllback; + $e->rollback; return 0; } diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.sip-config.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.sip-config.sql index 985aee41ea..7d22e45d9a 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.sip-config.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.sip-config.sql @@ -37,7 +37,8 @@ CREATE TABLE sip.account ( DEFERRABLE INITIALLY DEFERRED, workstation INTEGER REFERENCES actor.workstation(id), -- sessions for ephemeral accounts are not tracked in sip.session - ephemeral BOOLEAN NOT NULL DEFAULT FALSE + ephemeral BOOLEAN NOT NULL DEFAULT FALSE, + activity_who TEXT -- config.usr_activity_type.ewho ); CREATE TABLE sip.session ( @@ -83,6 +84,10 @@ VALUES ( 'patron_status_permit_all', 'false' ), ( (SELECT id FROM config.sip_setting_group WHERE institution = 'example'), + 'Patron holds data may be returned as either "title" or "barcode"', + 'default_activity_who', 'null' +), ( + (SELECT id FROM config.sip_setting_group WHERE institution = 'example'), 'Patron circulation data may be returned as either "title" or "barcode"', 'msg64_summary_datatype', '"title"' ), ( -- 2.11.0