From: Bill Erickson Date: Tue, 1 Sep 2020 19:50:36 +0000 (-0400) Subject: SIP2Mediator account mgmt cont X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d97a61e8268410d38c1178424f7bef8c80a72912;p=working%2FEvergreen.git SIP2Mediator account mgmt cont Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index cb2b244849..72fb487a11 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -13441,6 +13441,7 @@ SELECT usr, reporter:label="SIP AccountS"> + diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/SIP2Gateway.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/SIP2Gateway.pm index 11428f097d..294ba62042 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/SIP2Gateway.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/SIP2Gateway.pm @@ -179,12 +179,8 @@ sub init { my $e = new_editor(); my $settings = $e->retrieve_all_config_sip_setting; - my $accounts = $e->search_config_sip_account([ - {id => {'!=' => undef}}, - {flesh => 1, flesh_fields => {csa => ['workstation']}} - ]); - $config = {institutions => [], accounts => $accounts}; + $config = {institutions => []}; # Institution specific settings. # In addition to the settings, this tells us what institutions we support. @@ -333,9 +329,10 @@ sub handle_login { my $sip_username = get_field_value($message, 'CN'); my $sip_password = get_field_value($message, 'CO'); - - my ($sip_account) = - grep {$_->sip_username eq $sip_username} @{$config->{accounts}}; + my $sip_account = new_editor()->search_config_sip_account([ + {sip_username => $sip_username, enabled => 't'}, + {flesh => 1, flesh_fields => {csa => ['workstation']}} + ])->[0]; if (!$sip_account) { $logger->warn("SIP2: No such SIP account: $sip_username"); 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 fb7c304621..9b8567e098 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 @@ -5,6 +5,7 @@ BEGIN; CREATE TABLE config.sip_account ( id SERIAL PRIMARY KEY, + enabled BOOLEAN NOT NULL DEFAULT TRUE, institution TEXT NOT NULL, sip_username TEXT NOT NULL, sip_password BIGINT NOT NULL REFERENCES actor.passwd