#!/usr/bin/perl ############################################################################### # # # IPFire.org - A linux based firewall # # Copyright (C) 2011 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation, either version 3 of the License, or # # (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program. If not, see . # # # ############################################################################### use strict; # enable only the following on debugging purpose use warnings; use CGI::Carp 'fatalsToBrowser'; require '/var/ipfire/general-functions.pl'; require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; require '/opt/pakfire/lib/functions.pl'; my $configfile = "/var/ipfire/main/send_profile"; my %fireinfosettings=(); my $errormessage=''; &Header::showhttpheaders(); $fireinfosettings{'ENABLE_FIREINFO'} = 'off'; $fireinfosettings{'ACTION'} = ''; &Header::getcgihash(\%fireinfosettings); if ( -e "$configfile" ) { $fireinfosettings{'ENABLE_FIREINFO'} = 'on'; } if ("$fireinfosettings{'ACTION'}" eq "trigger") { if ($fireinfosettings{'ENABLE_FIREINFO'} eq 'off') { &General::log($Lang::tr{'fireinfo is enabled'}); # Write empty configfile. open(FILE, ">$configfile"); close(FILE); $fireinfosettings{'ENABLE_FIREINFO'} = 'on'; } else { &General::log($Lang::tr{'fireinfo is disabled'}); unlink "$configfile"; $fireinfosettings{'ENABLE_FIREINFO'} = 'off'; } &General::system_background("/usr/local/bin/fireinfoctrl"); } &Header::openpage('Fireinfo', 1, ''); if ($fireinfosettings{'ENABLE_FIREINFO'} ne "on") { &Header::openbox("100%", "left", "$Lang::tr{'fireinfo why enable'}"); print <

$Lang::tr{'fireinfo why descr1'} $Lang::tr{'fireinfo why descr2'}$Lang::tr{'fireinfo why read more'}

END &Header::closebox(); } &Header::openbigbox('100%', 'left', '', $errormessage); if ($errormessage) { &Header::openbox('100%', 'left', "$Lang::tr{'error messages'}"); print "$errormessage \n"; &Header::closebox(); } # Get IPFire version string. open(FILE, "/etc/system-release"); my $ipfire_version = ; close(FILE); my $pakfire_version = &Pakfire::make_version(); my @kernel_version = &General::system_output("uname", "-a"); &Header::openbox('100%', 'left', $Lang::tr{'fireinfo system version'}); print < $Lang::tr{'fireinfo ipfire version'} $ipfire_version $Lang::tr{'fireinfo pakfire version'} $pakfire_version $Lang::tr{'fireinfo kernel version'} @kernel_version END &Header::closebox(); # Read pregenerated profile data open(FILE, "/var/ipfire/fireinfo/profile"); my @profile = ; close(FILE); print "
\n"; # Read profile ID from file open(FILE, "/var/ipfire/fireinfo/public_id"); my $profile_id = ; close(FILE); chomp($profile_id); &Header::openbox('100%', 'left', $Lang::tr{'fireinfo settings'}); print <
$Lang::tr{'fireinfo your profile id'}: $profile_id
 
END if ($fireinfosettings{'ENABLE_FIREINFO'} eq "on") { print "$Lang::tr{'fireinfo is submitted'}"; } else { print "$Lang::tr{'fireinfo not submitted'}"; } print ""; if ($fireinfosettings{'ENABLE_FIREINFO'} eq "on") { print ""; } else { print ""; } print <
 
END ; &Header::closebox(); print "\n"; &Header::closebigbox(); &Header::closepage();