3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # Koha is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with Koha; if not, see <http://www.gnu.org/licenses>.
26 my $name = $File::Find::name;
54 && $name =~ m{\.(pl)$}
58 find({ wanted => \&wanted, no_chdir => 1 }, File::Spec->curdir());
60 my @missing_auth_check;
61 FILE: foreach my $name (@files) {
62 open( FILE, $name ) || die "cannot open file $name $!";
63 while ( my $line = <FILE> ) {
64 for my $routine ( qw( get_template_and_user check_cookie_auth checkauth check_api_auth C4::Service->init ) ) {
65 next FILE if $line =~ m|^[^#]*$routine|;
68 push @missing_auth_check, $name;
70 is( scalar @missing_auth_check, 0 ) or diag "No auth check in the following files:\n" . join "\n", @missing_auth_check;