reporter:label="SIP AccountS">
<fields oils_persist:primary="id" oils_persist:sequence="config.sip_account_id_seq">
<field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="sip_username"/>
+ <field name="enabled" reporter:datatype="bool" reporter:label="Enabled"/>
<field name="institution" reporter:datatype="text" reporter:label="Institution" oils_obj:required="true"/>
<field name="sip_username" reporter:datatype="text" reporter:label="SIP Username" oils_obj:required="true"/>
<field name="usr" reporter:datatype="link" reporter:label="ILS User" oils_obj:required="true"/>
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.
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");
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