mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 03:33:25 +02:00
gpl.cgi: Fix proper redirection so that the agreement has only to be accepted once.
This commit is contained in:
@@ -29,28 +29,29 @@ require "${General::swroot}/lang.pl";
|
|||||||
require "${General::swroot}/header.pl";
|
require "${General::swroot}/header.pl";
|
||||||
require "/opt/pakfire/lib/functions.pl";
|
require "/opt/pakfire/lib/functions.pl";
|
||||||
|
|
||||||
|
# If the license has already been accepted.
|
||||||
|
if ( -e "/var/ipfire/main/gpl_accepted" ) {
|
||||||
|
&redirect();
|
||||||
|
}
|
||||||
|
|
||||||
my %cgiparams;
|
my %cgiparams;
|
||||||
my $refresh;
|
|
||||||
|
|
||||||
if ( -e "/var/ipfire/main/gpl_accepted" ) {
|
|
||||||
print "Status: 302 Moved Temporarily\n";
|
|
||||||
print "Location: index.cgi\n\n";
|
|
||||||
exit (0);
|
|
||||||
}
|
|
||||||
&Header::showhttpheaders();
|
|
||||||
|
|
||||||
$cgiparams{'ACTION'} = '';
|
$cgiparams{'ACTION'} = '';
|
||||||
|
|
||||||
&Header::getcgihash(\%cgiparams);
|
&Header::getcgihash(\%cgiparams);
|
||||||
|
|
||||||
&Header::openpage($Lang::tr{'main page'}, 1, $refresh);
|
# Check if the license agreement has been accepted.
|
||||||
&Header::openbigbox('', 'center');
|
if ($cgiparams{'ACTION'} eq "$Lang::tr{'yes'}" && $cgiparams{'gpl_accepted'} eq '1') {
|
||||||
|
open(FILE, ">/var/ipfire/main/gpl_accepted");
|
||||||
|
close(FILE);
|
||||||
|
|
||||||
# licence agreement
|
&redirect();
|
||||||
if ($cgiparams{'ACTION'} eq $Lang::tr{'yes'} && $cgiparams{'gpl_accepted'} eq '1') {
|
|
||||||
system('touch /var/ipfire/main/gpl_accepted');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&Header::showhttpheaders();
|
||||||
|
|
||||||
|
&Header::openpage($Lang::tr{'main page'}, 1);
|
||||||
|
&Header::openbigbox('', 'center');
|
||||||
|
|
||||||
&Header::openbox('100%', 'left', $Lang::tr{'gpl license agreement'});
|
&Header::openbox('100%', 'left', $Lang::tr{'gpl license agreement'});
|
||||||
print <<END;
|
print <<END;
|
||||||
$Lang::tr{'gpl please read carefully the general public license and accept it below'}.
|
$Lang::tr{'gpl please read carefully the general public license and accept it below'}.
|
||||||
@@ -80,3 +81,9 @@ END
|
|||||||
&Header::closebox();
|
&Header::closebox();
|
||||||
&Header::closebigbox();
|
&Header::closebigbox();
|
||||||
&Header::closepage();
|
&Header::closepage();
|
||||||
|
|
||||||
|
sub redirect {
|
||||||
|
print "Status: 302 Moved Temporarily\n";
|
||||||
|
print "Location: index.cgi\n\n";
|
||||||
|
exit (0);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user