Lines 34-40
use Koha;
Link Here
|
34 |
use Koha::AuthUtils qw(get_script_name hash_password); |
34 |
use Koha::AuthUtils qw(get_script_name hash_password); |
35 |
use Koha::Libraries; |
35 |
use Koha::Libraries; |
36 |
use Koha::LibraryCategories; |
36 |
use Koha::LibraryCategories; |
37 |
use Koha::Libraries; |
|
|
38 |
use POSIX qw/strftime/; |
37 |
use POSIX qw/strftime/; |
39 |
use List::MoreUtils qw/ any /; |
38 |
use List::MoreUtils qw/ any /; |
40 |
use Encode qw( encode is_utf8); |
39 |
use Encode qw( encode is_utf8); |
Lines 1075-1081
sub checkauth {
Link Here
|
1075 |
# if they specify at login, use that |
1074 |
# if they specify at login, use that |
1076 |
if ( $query->param('branch') ) { |
1075 |
if ( $query->param('branch') ) { |
1077 |
$branchcode = $query->param('branch'); |
1076 |
$branchcode = $query->param('branch'); |
1078 |
$branchname = Koha::Libraries->find($branchcode)->branchname; |
1077 |
my $library = Koha::Libraries->find($branchcode); |
|
|
1078 |
$branchname = $library? $library->branchname: ''; |
1079 |
} |
1079 |
} |
1080 |
my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search }; |
1080 |
my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search }; |
1081 |
if ( C4::Context->boolean_preference('IndependentBranches') && C4::Context->boolean_preference('Autolocation') ) { |
1081 |
if ( C4::Context->boolean_preference('IndependentBranches') && C4::Context->boolean_preference('Autolocation') ) { |
Lines 1525-1531
sub check_api_auth {
Link Here
|
1525 |
# if they specify at login, use that |
1525 |
# if they specify at login, use that |
1526 |
if ( $query->param('branch') ) { |
1526 |
if ( $query->param('branch') ) { |
1527 |
$branchcode = $query->param('branch'); |
1527 |
$branchcode = $query->param('branch'); |
1528 |
$branchname = Koha::Libraries->find($branchcode)->branchname; |
1528 |
my $library = Koha::Libraries->find($branchcode); |
|
|
1529 |
$branchname = $library? $library->branchname: ''; |
1529 |
} |
1530 |
} |
1530 |
my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search }; |
1531 |
my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search }; |
1531 |
foreach my $br ( keys %$branches ) { |
1532 |
foreach my $br ( keys %$branches ) { |