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