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

(-)a/cataloguing/automatic_linker.pl (-4 / +2 lines)
Lines 32-38 print $input->header('application/json'); Link Here
32
# Check the user's permissions
32
# Check the user's permissions
33
my %cookies = fetch CGI::Cookie;
33
my %cookies = fetch CGI::Cookie;
34
my $sessid = $cookies{'CGISESSID'}->value || $input->param('CGISESSID');
34
my $sessid = $cookies{'CGISESSID'}->value || $input->param('CGISESSID');
35
my ($auth_status, $auth_sessid) = C4::Auth::check_cookie_auth($sessid, {"catalogue"});
35
my ($auth_status, $auth_sessid) = C4::Auth::check_cookie_auth($sessid, {catalogue => 1});
36
if ($auth_status ne "ok") {
36
if ($auth_status ne "ok") {
37
    print to_json({status => 'UNAUTHORIZED'});
37
    print to_json({status => 'UNAUTHORIZED'});
38
    exit 0;
38
    exit 0;
Lines 47-53 if ($auth_status ne "ok") { Link Here
47
47
48
my $json;
48
my $json;
49
49
50
my @params = $input->param();
51
my $record = TransformHtmlToMarc( $input );
50
my $record = TransformHtmlToMarc( $input );
52
51
53
52
Lines 62-68 if ($@) { Link Here
62
}
61
}
63
my $linker = $linker_module->new( { 'options' => C4::Context->preference("LinkerOptions") } );
62
my $linker = $linker_module->new( { 'options' => C4::Context->preference("LinkerOptions") } );
64
63
65
my ( $headings_changed, $results ) = LinkBibHeadingsToAuthorities( $linker, $record, $params['frameworkcode'], C4::Context->preference("CatalogModuleRelink") || '', 1 );
64
my ( $headings_changed, $results ) = LinkBibHeadingsToAuthorities( $linker, $record, $input->param('frameworkcode'), C4::Context->preference("CatalogModuleRelink") || '', 1 );
66
65
67
$json->{status} = 'OK';
66
$json->{status} = 'OK';
68
$json->{links} = $results->{details} || '';
67
$json->{links} = $results->{details} || '';
69
- 

Return to bug 11299