# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
-use strict;
-use warnings;
+use Modern::Perl;
use diagnostics;
use C4::InstallAuth;
#Whenever there is an error, adding a report to the page
my $op = $query->param('op') || 'noop';
$template->param( language => 1 );
+ my $checkmodule = 1;
$template->param( 'checkmodule' => 1 )
; # we start with the assumption that there are no problems and set this to 0 if there are
unless ( $] >= 5.010000 ) { # Bug 7375
$template->param( problems => 1, perlversion => 1, checkmodule => 0 );
+ $checkmodule = 0;
}
my $perl_modules = C4::Installer::PerlModules->new;
my $modules = $perl_modules->get_attr('missing_pm');
if ( scalar(@$modules) ) {
my @components = ();
- my $checkmodule = 1;
foreach (@$modules) {
my ( $module, $stats ) = each %$_;
$checkmodule = 0 if $stats->{'required'};
$template->param( 'checkdatabasecreated' => 1 );
}
- #Check if user have all necessary grants on this database.
- my $rq =
- $dbh->prepare(
- "SHOW GRANTS FOR \'$info{user}\'\@'$info{hostname}'");
+ # Check if user have all necessary grants on this database.
+ # CURRENT_USER is ANSI SQL, and doesn't require mysql table
+ # privileges, making the % check pointless, since they
+ # couldn't even check GRANTS if they couldn't connect.
+ my $rq = $dbh->prepare('SHOW GRANTS FOR CURRENT_USER');
$rq->execute;
my $grantaccess;
while ( my ($line) = $rq->fetchrow ) {
);
}
}
- unless ($grantaccess) {
- $rq =
- $dbh->prepare("SHOW GRANTS FOR \'$info{user}\'\@'\%'");
- $rq->execute;
- while ( my ($line) = $rq->fetchrow ) {
- my $dbname = $info{dbname};
- if ( $line =~ m/$dbname/ || index( $line, '*.*' ) > 0 )
- {
- $grantaccess = 1
- if (
- index( $line, 'ALL PRIVILEGES' ) > 0
- || ( ( index( $line, 'SELECT' ) > 0 )
- && ( index( $line, 'INSERT' ) > 0 )
- && ( index( $line, 'UPDATE' ) > 0 )
- && ( index( $line, 'DELETE' ) > 0 )
- && ( index( $line, 'CREATE' ) > 0 )
- && ( index( $line, 'DROP' ) > 0 ) )
- );
- }
- }
- }
$template->param( "checkgrantaccess" => $grantaccess );
} # End mysql connect check...
my ( $fwk_language, $list ) =
$installer->load_sql_in_order( $all_languages,
- scalar $query->param('framework') );
+ $query->multi_param('framework') );
$template->param(
"fwklanguage" => $fwk_language,
"list" => $list
# Where <level> is a category of requirement : required, recommended optional
# level should contain :
# SQL File for import With a readable name.
-# txt File taht explains what this SQL File is meant for.
+# txt File that explains what this SQL File is meant for.
# Could be VERY useful to have A Big file for a kind of library.
# But could also be useful to have some Authorised values data set prepared here.
# Marcflavour Selection is achieved through radiobuttons.
system($cmd );
my $fh;
- open( $fh, "<", $logfilepath )
+ open( $fh, "<:encoding(utf-8)", $logfilepath )
or die "Cannot open log file $logfilepath: $!";
my @report = <$fh>;
close $fh;
else {
eval { `rm $logfilepath` };
}
- open( $fh, "<", $logfilepath_errors )
+ open( $fh, "<:encoding(utf-8)", $logfilepath_errors )
or die "Cannot open log file $logfilepath_errors: $!";
@report = <$fh>;
close $fh;