From: Mike Rylander Date: Tue, 13 Sep 2016 20:37:22 +0000 (-0400) Subject: LP1579144: Let admin decide on the precedence of the location codes per institution X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=133bf03274eceaac4950e62f8f66c6c077474fbb;p=SIPServer.git LP1579144: Let admin decide on the precedence of the location codes per institution Signed-off-by: Mike Rylander --- diff --git a/SIPconfig.xml b/SIPconfig.xml index 6ba05a2..180f4d4 100644 --- a/SIPconfig.xml +++ b/SIPconfig.xml @@ -1,7 +1,7 @@ + 127.0.0.1:11211 @@ -64,7 +64,7 @@ - @@ -77,7 +77,7 @@ diff --git a/Sip/MsgType.pm b/Sip/MsgType.pm index 0f51459..29751f8 100644 --- a/Sip/MsgType.pm +++ b/Sip/MsgType.pm @@ -856,7 +856,18 @@ sub handle_login { syslog("LOG_WARNING", "MsgType::handle_login: Invalid password for login '$uid'"); $status = 0; } else { - $sc_loc ||= $server->{config}->{accounts}->{$uid}->{location_code}; + if (to_bool( + $server + ->{config} + ->{institutions} + ->{ $server->{config}->{accounts}->{$uid}->{institution} } + ->{policy} + ->{client_location_code} + )) { + $sc_loc ||= $server->{config}->{accounts}->{$uid}->{location_code}; + } else { + $sc_loc = $server->{config}->{accounts}->{$uid}->{location_code} || $sc_loc; + } _load_ils_handler($server, $uid, $sc_loc); }