Koha/tools/ajax-inventory.pl
Julian Maurice 96cc447045 Bug 25898: Prohibit indirect object notation
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-15 12:56:30 +02:00

23 lines
518 B
Perl
Executable file

#!/usr/bin/perl
use Modern::Perl;
use CGI qw ( -utf8 );
use C4::Auth;
use C4::Items qw( ModDateLastSeen );
my $input = CGI->new;
# Authentication
my ($status, $cookie, $sessionId) = C4::Auth::check_api_auth($input, { tools => 'inventory' });
exit unless ($status eq "ok");
my $seen = $input->param('seen');
my @seent = split(/\|/, $seen);
# mark seen if applicable (ie: coming form mark seen checkboxes)
foreach ( @seent ) {
/SEEN-(.+)/ and &ModDateLastSeen($1);
}
print $input->header('application/json');