]>
git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - html/cgi-bin/fireinfo.cgi
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
24 # enable only the following on debugging purpose
26 use CGI
::Carp
'fatalsToBrowser';
28 require '/var/ipfire/general-functions.pl';
29 require "${General::swroot}/lang.pl";
30 require "${General::swroot}/header.pl";
32 my $configfile = "/var/ipfire/main/send_profile";
34 my %fireinfosettings=();
37 &Header
::showhttpheaders
();
39 $fireinfosettings{'ENABLE_FIREINFO'} = 'off';
40 $fireinfosettings{'ACTION'} = '';
42 &Header
::getcgihash
(\
%fireinfosettings);
44 if ( -e
"$configfile" ) {
45 $fireinfosettings{'ENABLE_FIREINFO'} = 'on';
48 if ("$fireinfosettings{'ACTION'}" eq "trigger") {
49 if ($fireinfosettings{'ENABLE_FIREINFO'} eq 'off') {
50 &General
::log($Lang::tr
{'fireinfo is enabled'});
51 system ('/usr/bin/touch', $configfile);
52 $fireinfosettings{'ENABLE_FIREINFO'} = 'on';
54 &General
::log($Lang::tr
{'fireinfo is disabled'});
56 $fireinfosettings{'ENABLE_FIREINFO'} = 'off';
60 &Header
::openpage
('Fireinfo', 1, '');
62 if ($fireinfosettings{'ENABLE_FIREINFO'} ne "on") {
63 &Header
::openbox
("100%", "left", "Why should I enable fireinfo?");
66 <font color="$Header::colourred">
68 It is very important for the development of IPFire that you enable this
69 service. <a href="http://fireinfo.ipfire.org" target="_blank">Read more about the reasons.</a>
77 &Header
::openbigbox
('100%', 'left', '', $errormessage);
80 &Header
::openbox
('100%', 'left', "$Lang::tr{'error messages'}");
81 print "<FONT CLASS='base'>$errormessage </FONT>\n";
85 my $ipfire_version = `cat /etc/system-release`;
86 my $pakfire_version = `cat /opt/pakfire/etc/pakfire.conf | grep "version =" | cut -d\\" -f2`;
87 my $kernel_version = `uname -a`;
89 &Header
::openbox
('100%', 'left', $Lang::tr
{'fireinfo system version'});
93 <td>$Lang::tr{'fireinfo ipfire version'}:</td>
94 <td>$ipfire_version</td>
97 <td>$Lang::tr{'fireinfo pakfire version'}:</td>
98 <td>$pakfire_version</td>
101 <td>$Lang::tr{'fireinfo kernel version'}:</td>
102 <td>$kernel_version</td>
108 # Read pregenerated profile data
109 my $profile = `cat /var/ipfire/fireinfo/profile`;
111 print "<form method='post' action='$ENV{'SCRIPT_NAME'}'>\n";
113 # Read profile ID from file
114 my $profile_id = `cat /var/ipfire/fireinfo/public_id`;
117 &Header
::openbox
('100%', 'left', $Lang::tr
{'fireinfo settings'});
119 <input type='hidden' name='ACTION' value='trigger' />
122 <td>$Lang::tr{'fireinfo your profile id'}:</td>
124 <a href="http://fireinfo.ipfire.org/profile/$profile_id" target="_blank">$profile_id</a>
129 <td colspan="2"> </td>
135 if ($fireinfosettings{'ENABLE_FIREINFO'} eq "on") {
136 print "<font color='$Header::colourgreen'>$Lang::tr{'fireinfo is submitted'}</font>";
138 print "<font color='$Header::colourred'>$Lang::tr{'fireinfo not submitted'}</font>";
143 if ($fireinfosettings{'ENABLE_FIREINFO'} eq "on") {
144 print "<input type='submit' name='submit' value=\"$Lang::tr{'fireinfo is submitted button'}\" />";
146 print "<input type='submit' name='submit' value=\"$Lang::tr{'fireinfo not submitted button'}\" />";
154 <td colspan="2"> </td>
158 <textarea rows="25" cols="75" readonly="true">$profile</textarea>
167 &Header
::closebigbox
();
168 &Header
::closepage
();