Bug 3609 Fix fr-FR user permissions
[koha.git] / cataloguing / merge_ajax.pl
1 #!/usr/bin/perl
2
3 use strict;
4
5 # standard or CPAN modules used
6 use IO::File;
7 use CGI;
8 use CGI::Session;
9 use C4::Context;
10 use C4::Biblio;
11 use C4::Auth qw/check_cookie_auth/;
12 use C4::UploadedFile;
13 use JSON;
14 use CGI::Cookie; # need to check cookies before
15                  # having CGI parse the POST request
16
17 my %cookies = fetch CGI::Cookie;
18 my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { editcatalogue => '1' });
19 if ($auth_status ne "ok") {
20     my $reply = CGI->new("");
21     print $reply->header(-type => 'text/html');
22     exit 0;
23
24
25 my $reply = new CGI;
26 my $framework = $reply->param('frameworkcode');
27 my $tagslib = GetMarcStructure(1, $framework);
28 print $reply->header(-type => 'text/html');
29 print encode_json $tagslib;