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

(-)a/cataloguing/value_builder/EXAMPLE.pl (+2 lines)
Lines 57-62 use C4::Output qw( output_html_with_http_headers ); Link Here
57
# event.data.id. This makes a difference when the field is cloned or has
57
# event.data.id. This makes a difference when the field is cloned or has
58
# been created dynamically (as in additem.js).
58
# been created dynamically (as in additem.js).
59
59
60
C4::Auth::check_value_builder_caller();
61
60
my $builder= sub {
62
my $builder= sub {
61
    my $params = shift;
63
    my $params = shift;
62
    my $id = $params->{id};
64
    my $id = $params->{id};
(-)a/cataloguing/value_builder/barcode_manual.pl (-9 / +2 lines)
Lines 22-41 Link Here
22
22
23
use Modern::Perl;
23
use Modern::Perl;
24
24
25
use C4::Auth ();
25
use C4::Context;
26
use C4::Context;
26
use C4::Barcodes::ValueBuilder;
27
use C4::Barcodes::ValueBuilder;
27
use C4::Biblio qw( GetMarcFromKohaField );
28
use C4::Biblio qw( GetMarcFromKohaField );
28
use Koha::DateUtils qw( dt_from_string );
29
use Koha::DateUtils qw( dt_from_string );
29
30
30
use CGI qw ( -utf8 );
31
C4::Auth::check_value_builder_caller();
31
use C4::Auth qw( check_cookie_auth );
32
my $input = CGI->new;
33
my ($auth_status) =
34
    check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => 1 } );
35
if ( $auth_status ne "ok" ) {
36
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
37
    exit 0;
38
}
39
32
40
my $builder = sub {
33
my $builder = sub {
41
    my ( $params ) = @_;
34
    my ( $params ) = @_;
(-)a/cataloguing/value_builder/callnumber-KU.pl (+2 lines)
Lines 42-47 CCC QW - returns first unused number CCC QWxx starting with CCC QW01 Link Here
42
42
43
=cut
43
=cut
44
44
45
C4::Auth::check_value_builder_caller();
46
45
my $builder = sub {
47
my $builder = sub {
46
    my ( $params ) = @_;
48
    my ( $params ) = @_;
47
    my $res="
49
    my $res="
(-)a/cataloguing/value_builder/callnumber.pl (+2 lines)
Lines 39-44 In this case, a callnumber has this form : "PREFIX 0009678570". Link Here
39
39
40
=cut
40
=cut
41
41
42
C4::Auth::check_value_builder_caller();
43
42
my $builder = sub {
44
my $builder = sub {
43
    my ( $params ) = @_;
45
    my ( $params ) = @_;
44
    my $res="
46
    my $res="
(-)a/cataloguing/value_builder/cn_browser.pl (-1 / +2 lines)
Lines 24-32 use Modern::Perl; Link Here
24
use C4::Auth qw( get_template_and_user );
24
use C4::Auth qw( get_template_and_user );
25
use C4::ClassSource qw( GetClassSort );
25
use C4::ClassSource qw( GetClassSort );
26
use C4::Output qw( output_html_with_http_headers );
26
use C4::Output qw( output_html_with_http_headers );
27
28
use Koha::ClassSources;
27
use Koha::ClassSources;
29
28
29
C4::Auth::check_value_builder_caller();
30
30
my $builder = sub {
31
my $builder = sub {
31
    my ( $params ) = @_;
32
    my ( $params ) = @_;
32
    my $function_name = $params->{id};
33
    my $function_name = $params->{id};
(-)a/cataloguing/value_builder/marc21_field_005.pl (-9 / +2 lines)
Lines 20-35 Link Here
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
21
22
use Modern::Perl;
22
use Modern::Perl;
23
use C4::Auth ();
23
24
24
use CGI qw ( -utf8 );
25
C4::Auth::check_value_builder_caller();
25
use C4::Auth qw( check_cookie_auth );
26
my $input = CGI->new;
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
26
34
my $builder = sub {
27
my $builder = sub {
35
    my ( $params ) = @_;
28
    my ( $params ) = @_;
(-)a/cataloguing/value_builder/marc21_field_006.pl (-3 / +3 lines)
Lines 20-33 Link Here
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
21
22
use Modern::Perl;
22
use Modern::Perl;
23
use XML::LibXML;
24
23
use C4::Auth qw( get_template_and_user );
25
use C4::Auth qw( get_template_and_user );
24
use CGI qw ( -utf8 );
25
use C4::Context;
26
use C4::Context;
26
27
use C4::Search;
27
use C4::Search;
28
use C4::Output qw( output_html_with_http_headers );
28
use C4::Output qw( output_html_with_http_headers );
29
29
30
use XML::LibXML;
30
C4::Auth::check_value_builder_caller();
31
31
32
my $builder = sub {
32
my $builder = sub {
33
    my ( $params ) = @_;
33
    my ( $params ) = @_;
(-)a/cataloguing/value_builder/marc21_field_007.pl (-2 / +2 lines)
Lines 22-33 Link Here
22
use Modern::Perl;
22
use Modern::Perl;
23
23
24
use C4::Auth qw( get_template_and_user );
24
use C4::Auth qw( get_template_and_user );
25
use CGI qw ( -utf8 );
26
use C4::Context;
25
use C4::Context;
27
28
use C4::Search;
26
use C4::Search;
29
use C4::Output qw( output_html_with_http_headers );
27
use C4::Output qw( output_html_with_http_headers );
30
28
29
C4::Auth::check_value_builder_caller();
30
31
my $builder = sub {
31
my $builder = sub {
32
    my ( $params ) = @_;
32
    my ( $params ) = @_;
33
    my $function_name = $params->{id};
33
    my $function_name = $params->{id};
(-)a/cataloguing/value_builder/marc21_field_008.pl (-4 / +4 lines)
Lines 20-35 Link Here
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
21
22
use Modern::Perl;
22
use Modern::Perl;
23
use XML::LibXML;
24
23
use C4::Auth qw( get_template_and_user );
25
use C4::Auth qw( get_template_and_user );
24
use CGI qw ( -utf8 );
25
use C4::Context;
26
use C4::Context;
26
27
use C4::Search;
27
use C4::Search;
28
use C4::Output qw( output_html_with_http_headers );
28
use C4::Output qw( output_html_with_http_headers );
29
30
use XML::LibXML;
31
use Koha::Util::FrameworkPlugin qw( biblio_008 );
29
use Koha::Util::FrameworkPlugin qw( biblio_008 );
32
30
31
C4::Auth::check_value_builder_caller();
32
33
my $builder = sub {
33
my $builder = sub {
34
    my ( $params ) = @_;
34
    my ( $params ) = @_;
35
35
(-)a/cataloguing/value_builder/marc21_field_008_authorities.pl (-2 / +2 lines)
Lines 21-29 Link Here
21
21
22
use Modern::Perl;
22
use Modern::Perl;
23
use C4::Auth qw( get_template_and_user );
23
use C4::Auth qw( get_template_and_user );
24
use CGI qw ( -utf8 );
25
use C4::Context;
24
use C4::Context;
26
27
use C4::Search;
25
use C4::Search;
28
use C4::Output qw( output_html_with_http_headers );
26
use C4::Output qw( output_html_with_http_headers );
29
use Koha::Util::FrameworkPlugin qw|date_entered|;
27
use Koha::Util::FrameworkPlugin qw|date_entered|;
Lines 31-36 use Koha::Util::FrameworkPlugin qw|date_entered|; Link Here
31
use constant FIXLEN_DATA_ELTS => '|| aca||aabn           | a|a     d';
29
use constant FIXLEN_DATA_ELTS => '|| aca||aabn           | a|a     d';
32
use constant PREF_008 => 'MARCAuthorityControlField008';
30
use constant PREF_008 => 'MARCAuthorityControlField008';
33
31
32
C4::Auth::check_value_builder_caller();
33
34
my $builder = sub {
34
my $builder = sub {
35
    my ( $params ) = @_;
35
    my ( $params ) = @_;
36
    my $function_name = $params->{id};
36
    my $function_name = $params->{id};
(-)a/cataloguing/value_builder/marc21_field_008_classifications.pl (-2 / +2 lines)
Lines 17-31 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
use C4::Auth qw( get_template_and_user );
19
use C4::Auth qw( get_template_and_user );
20
use CGI qw ( -utf8 );
21
use C4::Context;
20
use C4::Context;
22
23
use C4::Search;
21
use C4::Search;
24
use C4::Output qw( output_html_with_http_headers );
22
use C4::Output qw( output_html_with_http_headers );
25
use Koha::Util::FrameworkPlugin qw|date_entered|;
23
use Koha::Util::FrameworkPlugin qw|date_entered|;
26
24
27
use constant FIXLEN_DATA_ELTS => 'baaaaaaa';
25
use constant FIXLEN_DATA_ELTS => 'baaaaaaa';
28
26
27
C4::Auth::check_value_builder_caller();
28
29
my $builder = sub {
29
my $builder = sub {
30
    my ( $params ) = @_;
30
    my ( $params ) = @_;
31
    my $function_name = $params->{id};
31
    my $function_name = $params->{id};
(-)a/cataloguing/value_builder/marc21_field_245h.pl (-10 / +2 lines)
Lines 20-36 Link Here
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
21
22
use Modern::Perl;
22
use Modern::Perl;
23
use C4::Auth ();
23
24
24
use CGI qw ( -utf8 );
25
C4::Auth::check_value_builder_caller();
25
use C4::Auth qw( check_cookie_auth );
26
my $input = CGI->new;
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
34
26
35
my $builder = sub {
27
my $builder = sub {
36
    my ( $params ) = @_;
28
    my ( $params ) = @_;
(-)a/cataloguing/value_builder/marc21_field_260b.pl (-10 / +2 lines)
Lines 25-41 biblioitems.publishercode Link Here
25
=cut
25
=cut
26
26
27
use Modern::Perl;
27
use Modern::Perl;
28
use C4::Context;
28
use C4::Auth ();
29
29
30
use CGI qw ( -utf8 );
30
C4::Auth::check_value_builder_caller();
31
use C4::Auth qw( check_cookie_auth );
32
my $input = CGI->new;
33
my ($auth_status) =
34
    check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => 1 } );
35
if ( $auth_status ne "ok" ) {
36
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
37
    exit 0;
38
}
39
31
40
my $builder = sub {
32
my $builder = sub {
41
    my ( $params ) = @_;
33
    my ( $params ) = @_;
(-)a/cataloguing/value_builder/marc21_leader.pl (-2 / +2 lines)
Lines 20-31 Link Here
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
21
22
use Modern::Perl;
22
use Modern::Perl;
23
use CGI qw ( -utf8 );
24
25
use C4::Auth qw( get_template_and_user );
23
use C4::Auth qw( get_template_and_user );
26
use C4::Context;
24
use C4::Context;
27
use C4::Output qw( output_html_with_http_headers );
25
use C4::Output qw( output_html_with_http_headers );
28
26
27
C4::Auth::check_value_builder_caller();
28
29
my $builder = sub {
29
my $builder = sub {
30
    my ( $params ) = @_;
30
    my ( $params ) = @_;
31
    my $function_name = $params->{id};
31
    my $function_name = $params->{id};
(-)a/cataloguing/value_builder/marc21_leader_authorities.pl (-3 / +2 lines)
Lines 22-33 Link Here
22
use Modern::Perl;
22
use Modern::Perl;
23
23
24
use C4::Auth qw( get_template_and_user );
24
use C4::Auth qw( get_template_and_user );
25
use CGI qw ( -utf8 );
26
use C4::Context;
25
use C4::Context;
27
28
use C4::Search;
29
use C4::Output qw( output_html_with_http_headers );
26
use C4::Output qw( output_html_with_http_headers );
30
27
28
C4::Auth::check_value_builder_caller();
29
31
my $builder = sub {
30
my $builder = sub {
32
    my ( $params ) = @_;
31
    my ( $params ) = @_;
33
    my $function_name = $params->{id};
32
    my $function_name = $params->{id};
(-)a/cataloguing/value_builder/marc21_linking_section.pl (-7 / +5 lines)
Lines 21-41 Link Here
21
21
22
use Modern::Perl;
22
use Modern::Perl;
23
23
24
use CGI qw ( -utf8 );
25
use C4::Output qw( output_html_with_http_headers );
26
use C4::Context;
27
use C4::Search qw( new_record_from_zebra );
28
use C4::Auth qw( get_template_and_user );
24
use C4::Auth qw( get_template_and_user );
29
use C4::Output qw( output_html_with_http_headers );
30
31
use C4::Biblio qw( TransformMarcToKoha );
25
use C4::Biblio qw( TransformMarcToKoha );
26
use C4::Context;
27
use C4::Output qw( output_html_with_http_headers );
28
use C4::Search qw( new_record_from_zebra );
32
29
33
use Koha::Biblios;
30
use Koha::Biblios;
34
use Koha::ItemTypes;
31
use Koha::ItemTypes;
35
36
use Koha::SearchEngine;
32
use Koha::SearchEngine;
37
use Koha::SearchEngine::Search;
33
use Koha::SearchEngine::Search;
38
34
35
C4::Auth::check_value_builder_caller();
36
39
my $builder = sub {
37
my $builder = sub {
40
    my ( $params ) = @_;
38
    my ( $params ) = @_;
41
    my $function_name = $params->{id};
39
    my $function_name = $params->{id};
(-)a/cataloguing/value_builder/marc21_orgcode.pl (-10 / +3 lines)
Lines 21-38 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 C4::Auth ();
24
use C4::Context;
25
use C4::Context;
25
26
use Koha::Libraries;
26
use Koha::Libraries;
27
use CGI qw ( -utf8 );
27
28
use C4::Auth qw( check_cookie_auth );
28
C4::Auth::check_value_builder_caller();
29
my $input = CGI->new;
30
my ($auth_status) =
31
    check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => 1 } );
32
if ( $auth_status ne "ok" ) {
33
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
34
    exit 0;
35
}
36
29
37
my $builder = sub {
30
my $builder = sub {
38
    my ( $params ) = @_;
31
    my ( $params ) = @_;
(-)a/cataloguing/value_builder/stocknumber.pl (-9 / +3 lines)
Lines 20-35 Link Here
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
21
22
use Modern::Perl;
22
use Modern::Perl;
23
use C4::Auth ();
23
use C4::Context;
24
use C4::Context;
24
use CGI qw ( -utf8 );
25
25
use C4::Auth qw( check_cookie_auth );
26
C4::Auth::check_value_builder_caller();
26
my $input = CGI->new;
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/cataloguing/value_builder/stocknumberAV.pl (-2 / +2 lines)
Lines 20-27 Link Here
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
21
22
use Modern::Perl;
22
use Modern::Perl;
23
use CGI qw ( -utf8 );
24
25
use C4::Auth qw( get_template_and_user );
23
use C4::Auth qw( get_template_and_user );
26
use C4::Output qw( output_html_with_http_headers );
24
use C4::Output qw( output_html_with_http_headers );
27
use Koha::AuthorisedValues;
25
use Koha::AuthorisedValues;
Lines 43-48 PREFIX containing letters, a space separator and 10 digits with leading Link Here
43
41
44
=cut
42
=cut
45
43
44
C4::Auth::check_value_builder_caller();
45
46
my $builder = sub {
46
my $builder = sub {
47
    my ( $params ) = @_;
47
    my ( $params ) = @_;
48
    my $res = qq{
48
    my $res = qq{
(-)a/cataloguing/value_builder/stocknumberam123.pl (-2 / +2 lines)
Lines 20-27 Link Here
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
21
22
use Modern::Perl;
22
use Modern::Perl;
23
use CGI qw ( -utf8 );
24
25
use C4::Auth qw( get_template_and_user );
23
use C4::Auth qw( get_template_and_user );
26
use C4::Context;
24
use C4::Context;
27
use C4::Output qw( output_html_with_http_headers );
25
use C4::Output qw( output_html_with_http_headers );
Lines 40-45 In this case, a stocknumber has this form : "PREFIX 0009678570". Link Here
40
38
41
=cut
39
=cut
42
40
41
C4::Auth::check_value_builder_caller();
42
43
my $builder = sub {
43
my $builder = sub {
44
    my ( $params ) = @_;
44
    my ( $params ) = @_;
45
    my $res="
45
    my $res="
(-)a/cataloguing/value_builder/upload.pl (-11 / +4 lines)
Lines 20-26 Link Here
20
# You should have received a copy of the GNU General Public License
20
# You should have received a copy of the GNU General Public License
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;
24
23
25
# This plugin does not use the plugin launcher. It refers to tools/upload.pl.
24
# This plugin does not use the plugin launcher. It refers to tools/upload.pl.
26
# That script and template support using it as a plugin.
25
# That script and template support using it as a plugin.
Lines 30-44 use Modern::Perl; Link Here
30
# the possibility to delete the uploaded file. If the field is empty, you
29
# the possibility to delete the uploaded file. If the field is empty, you
31
# can upload a new file.
30
# can upload a new file.
32
31
33
use CGI qw ( -utf8 );
32
use Modern::Perl;
34
use C4::Auth qw( check_cookie_auth );
33
use C4::Auth ();
35
my $input = CGI->new;
34
36
my ($auth_status) =
35
C4::Auth::check_value_builder_caller();
37
    check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => 1 } );
38
if ( $auth_status ne "ok" ) {
39
    print $input->header( -type => 'text/plain', -status => '403 Forbidden' );
40
    exit 0;
41
}
42
36
43
my $builder = sub {
37
my $builder = sub {
44
    my ( $params ) = @_;
38
    my ( $params ) = @_;
45
- 

Return to bug 37041