From 131f163ce8b12f2b9aefde91d203441257e2642a Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 11 Feb 2020 14:28:48 +0000 Subject: [PATCH] pakfire.cgi: Rename %pakfiresettings to %cgiparams Signed-off-by: Michael Tremer Signed-off-by: Arne Fitzenreiter --- html/cgi-bin/pakfire.cgi | 47 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index 7c560bfbf2..f785b25943 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -30,22 +30,23 @@ require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; require "/opt/pakfire/lib/functions.pl"; -my %pakfiresettings=(); +my %cgiparams=(); my $errormessage = ''; my %color = (); +my %pakfiresettings = (); my %mainsettings = (); &Header::showhttpheaders(); -$pakfiresettings{'ACTION'} = ''; -$pakfiresettings{'VALID'} = ''; +$cgiparams{'ACTION'} = ''; +$cgiparams{'VALID'} = ''; -$pakfiresettings{'INSPAKS'} = ''; -$pakfiresettings{'DELPAKS'} = ''; +$cgiparams{'INSPAKS'} = ''; +$cgiparams{'DELPAKS'} = ''; sub refreshpage{&Header::openbox( 'Waiting', 1, "" );print "

$Lang::tr{'pagerefresh'}
";&Header::closebox();} -&Header::getcgihash(\%pakfiresettings); +&Header::getcgihash(\%cgiparams); &General::readhash("${General::swroot}/main/settings", \%mainsettings); &General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color); @@ -53,17 +54,17 @@ sub refreshpage{&Header::openbox( 'Waiting', 1, "$Lang::tr{'pakfire install package'}.$pakfiresettings{'INSPAKS'}.$Lang::tr{'pakfire possible dependency'} +
$Lang::tr{'pakfire install package'}.$cgiparams{'INSPAKS'}.$Lang::tr{'pakfire possible dependency'}
 END
 		foreach (@output) {
@@ -75,7 +76,7 @@ END
 		
$Lang::tr{'pakfire accept all'}
 
- + @@ -92,18 +93,18 @@ END &Header::closepage(); exit; } -} elsif ($pakfiresettings{'ACTION'} eq 'remove') { +} elsif ($cgiparams{'ACTION'} eq 'remove') { - $pakfiresettings{'DELPAKS'} =~ s/\|/\ /g; - if ("$pakfiresettings{'FORCE'}" eq "on") { - my $command = "/usr/local/bin/pakfire remove --non-interactive --no-colors $pakfiresettings{'DELPAKS'} &>/dev/null &"; + $cgiparams{'DELPAKS'} =~ s/\|/\ /g; + if ("$cgiparams{'FORCE'}" eq "on") { + my $command = "/usr/local/bin/pakfire remove --non-interactive --no-colors $cgiparams{'DELPAKS'} &>/dev/null &"; system("$command"); system("/bin/sleep 1"); } else { &Header::openbox("100%", "center", $Lang::tr{'request'}); - my @output = `/usr/local/bin/pakfire resolvedeps --no-colors $pakfiresettings{'DELPAKS'}`; + my @output = `/usr/local/bin/pakfire resolvedeps --no-colors $cgiparams{'DELPAKS'}`; print <
$Lang::tr{'pakfire uninstall package'}.$pakfiresettings{'DELPAKS'}.$Lang::tr{'pakfire possible dependency'} +
$Lang::tr{'pakfire uninstall package'}.$cgiparams{'DELPAKS'}.$Lang::tr{'pakfire possible dependency'}
 END
 		foreach (@output) {
@@ -115,7 +116,7 @@ END
 		
$Lang::tr{'pakfire accept all'}
 
- + @@ -133,15 +134,15 @@ END exit; } -} elsif ($pakfiresettings{'ACTION'} eq 'update') { +} elsif ($cgiparams{'ACTION'} eq 'update') { system("/usr/local/bin/pakfire update --force --no-colors &>/dev/null &"); system("/bin/sleep 1"); -} elsif ($pakfiresettings{'ACTION'} eq 'upgrade') { +} elsif ($cgiparams{'ACTION'} eq 'upgrade') { my $command = "/usr/local/bin/pakfire upgrade -y --no-colors &>/dev/null &"; system("$command"); system("/bin/sleep 1"); -} elsif ($pakfiresettings{'ACTION'} eq "$Lang::tr{'save'}") { +} elsif ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}") { &General::writehash("${General::swroot}/pakfire/settings", \%pakfiresettings); } -- 2.39.2