X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=serials%2Fsubscription-numberpattern.pl;h=bcb7eae45e6879b482d3cf439c8fa6687dff75c7;hb=0f6882896d6a806fb474b1fd172e3e93919d960c;hp=c54f2648a33cc43d9c147abf359ef75154942439;hpb=60508cb03d825f515461c1898361ac0eb3cffb2b;p=koha.git diff --git a/serials/subscription-numberpattern.pl b/serials/subscription-numberpattern.pl index c54f2648a3..bcb7eae45e 100755 --- a/serials/subscription-numberpattern.pl +++ b/serials/subscription-numberpattern.pl @@ -1,12 +1,36 @@ #!/usr/bin/perl +# Copyright 2011-2013 Biblibre SARL +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; use CGI; use C4::Serials::Numberpattern; +use C4::Auth qw/check_cookie_auth/; use URI::Escape; -use strict; -use warnings; my $input=new CGI; + +my ($auth_status, $sessionID) = check_cookie_auth($input->cookie('CGISESSID'), { serials => '*' }); +if ($auth_status ne "ok") { + print $input->header(-type => 'text/plain', -status => '403 Forbidden'); + exit 0; +} + my $numpatternid=$input->param("numberpattern_id"); my $numberpatternrecord=GetSubscriptionNumberpattern($numpatternid);