View | Details | Raw Unified | Return to bug 37041
Collapse All | Expand All

(-)a/cataloguing/value_builder/barcode.pl (-15 / +7 lines)
Lines 21-43 Link Here
21
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
# along with Koha; if not, see <http://www.gnu.org/licenses>.
22
22
23
use Modern::Perl;
23
use Modern::Perl;
24
25
use C4::Context;
26
use C4::Barcodes::ValueBuilder;
27
use C4::Biblio qw( GetMarcFromKohaField );
28
use Koha::DateUtils qw( dt_from_string );
29
30
use Algorithm::CheckDigits qw( CheckDigits );
24
use Algorithm::CheckDigits qw( CheckDigits );
31
25
32
use CGI qw ( -utf8 );
26
use C4::Auth                   qw();
33
use C4::Auth qw( check_cookie_auth );
27
use C4::Context                qw();
34
my $input = CGI->new;
28
use C4::Barcodes::ValueBuilder qw();
35
my ($auth_status) =
29
use C4::Biblio                 qw( GetMarcFromKohaField );
36
    check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => 1 } );
30
use Koha::DateUtils            qw( dt_from_string );
37
if ( $auth_status ne "ok" ) {
31
38
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
32
C4::Auth::check_value_builder_caller();
39
    exit 0;
40
}
41
33
42
my $builder = sub {
34
my $builder = sub {
43
    my ( $params ) = @_;
35
    my ( $params ) = @_;
(-)a/cataloguing/value_builder/dateaccessioned.pl (-9 / +3 lines)
Lines 21-35 Link Here
21
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
# along with Koha; if not, see <http://www.gnu.org/licenses>.
22
22
23
use Modern::Perl;
23
use Modern::Perl;
24
use CGI qw ( -utf8 );
24
use C4::Auth ();
25
use C4::Auth qw( check_cookie_auth );
25
26
my $input = CGI->new;
26
C4::Auth::check_value_builder_caller();
27
my ($auth_status) =
28
    check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => 1 } );
29
if ( $auth_status ne "ok" ) {
30
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
31
    exit 0;
32
}
33
27
34
my $builder = sub {
28
my $builder = sub {
35
    my ( $params ) = @_;
29
    my ( $params ) = @_;
(-)a/t/db_dependent/FrameworkPlugin.t (-2 / +10 lines)
Lines 1-9 Link Here
1
#!/usr/bin/perl
2
1
use Modern::Perl;
3
use Modern::Perl;
2
4
3
use CGI;
5
use CGI;
4
use File::Temp qw/tempfile/;
6
use File::Temp qw/tempfile/;
5
use Getopt::Long;
7
use Getopt::Long;
6
use Test::More tests => 7;
8
use Test::More tests => 8;
7
use Test::MockModule;
9
use Test::MockModule;
8
use Test::Warn;
10
use Test::Warn;
9
11
Lines 75-80 subtest 'Test07 -- validate input' => sub { Link Here
75
77
76
};
78
};
77
79
80
subtest 'Test08 -- check_value_builder_caller' => sub {
81
    plan tests => 1;
82
83
    # This is very trivial; note that previous ->build and ->launch calls trigger this routine also.
84
    is( C4::Auth::check_value_builder_caller( { exit => 0 } ), undef, 'Returns undef in unit test' );
85
};
86
78
$schema->storage->txn_rollback;
87
$schema->storage->txn_rollback;
79
88
80
sub test01 {
89
sub test01 {
81
- 

Return to bug 37041