X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Ftripwire.cgi;h=696a52e1ee1f343f467f16ab007933a2c5d0780e;hp=d33fa33add996267a1d3c023890c2a8152277e49;hb=2b52f309aa94a875dc96bcf4e40d5ed356f3b0ab;hpb=0a58fbcb92a5129f337d9dea5ea221ac19db09a0
diff --git a/html/cgi-bin/tripwire.cgi b/html/cgi-bin/tripwire.cgi
index d33fa33add..696a52e1ee 100644
--- a/html/cgi-bin/tripwire.cgi
+++ b/html/cgi-bin/tripwire.cgi
@@ -1,15 +1,28 @@
#!/usr/bin/perl
-#
-# IPFire CGIs
-#
-# This code is distributed under the terms of the GPL
-#
-# (c) The IPFire Team
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# #
+# 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';
+#use warnings;
+#use CGI::Carp 'fatalsToBrowser';
require '/var/ipfire/general-functions.pl';
require "${General::swroot}/lang.pl";
@@ -20,11 +33,16 @@ my %checked = ();
my %netsettings = ();
my $message = "";
my $errormessage = "";
-my @Logs = qx(ls -r /var/ipfire/tripwire/report/);
-my $file = `ls -tr /var/ipfire/tripwire/report/ | tail -1`;
-my @cronjobs = `ls /etc/fcron.daily/tripwire*`;
+my @Logs = `ls -r /var/ipfire/tripwire/report/ 2>/dev/null`;
+my $file = `ls -tr /var/ipfire/tripwire/report/ | tail -1 2>/dev/null`;
+my @cronjobs = `ls /etc/fcron.daily/tripwire* 2>/dev/null`;
my $Log =$Lang::tr{'no log selected'};
+my %color = ();
+my %mainsettings = ();
+&General::readhash("${General::swroot}/main/settings", \%mainsettings);
+&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
+
############################################################################################################################
################################################# Tripwire Default Variablen ################################################
@@ -65,7 +83,7 @@ $tripwiresettings{'ACTION'} = '';
if ($tripwiresettings{'ACTION'} eq $Lang::tr{'save'})
{
-system("/usr/local/bin/tripwirectrl readconfig >& /dev/null");
+system("/usr/local/bin/tripwirectrl readconfig >/dev/null 2>&1");
open (FILE, ">${General::swroot}/tripwire/twcfg.txt") or die "Can't save tripwire config: $!";
flock (FILE, 2);
@@ -94,7 +112,7 @@ END
close FILE;
&General::writehash("${General::swroot}/tripwire/settings", \%tripwiresettings);
-system("/usr/local/bin/tripwirectrl lockconfig >& /dev/null");
+system("/usr/local/bin/tripwirectrl lockconfig >/dev/null 2>&1");
}
############################################################################################################################
@@ -105,14 +123,14 @@ if ($tripwiresettings{'ACTION'} eq 'addcron')
print <
-
$Lang::tr{'add cron'}
+
$Lang::tr{'add cron'}
@@ -125,13 +143,13 @@ if ($tripwiresettings{'ACTION'} eq 'globalreset')
print <
-
$Lang::tr{'resetglobals'}
+
$Lang::tr{'resetglobals'}
$Lang::tr{'defaultwarning'}
- $Lang::tr{'ok'}
+ $Lang::tr{'ok'}
- $Lang::tr{'cancel'}
+ $Lang::tr{'cancel'}
@@ -144,15 +162,15 @@ if ($tripwiresettings{'ACTION'} eq 'generatepolicypw')
print <
-
$Lang::tr{'generatepolicy'}
+
$Lang::tr{'generatepolicy'}
$Lang::tr{'tripwirewarningpolicy'}
$Lang::tr{'sitekey'}
$Lang::tr{'localkey'}
- $Lang::tr{'ok'}
+ $Lang::tr{'ok'}
- $Lang::tr{'cancel'}
+ $Lang::tr{'cancel'}
@@ -165,15 +183,15 @@ if ($tripwiresettings{'ACTION'} eq 'policyresetpw')
print <
-
$Lang::tr{'resetpolicy'}
+
$Lang::tr{'resetpolicy'}
$Lang::tr{'tripwirewarningpolicy'}
$Lang::tr{'sitekey'}
$Lang::tr{'localkey'}
- $Lang::tr{'ok'}
+ $Lang::tr{'ok'}
- $Lang::tr{'cancel'}
+ $Lang::tr{'cancel'}
@@ -186,14 +204,14 @@ if ($tripwiresettings{'ACTION'} eq 'updatedatabasepw')
print <
-
$Lang::tr{'updatedatabase'}
+
$Lang::tr{'updatedatabase'}
$Lang::tr{'tripwirewarningdatabase'}
$Lang::tr{'localkey'}
- $Lang::tr{'ok'}
+ $Lang::tr{'ok'}
- $Lang::tr{'cancel'}
+ $Lang::tr{'cancel'}
@@ -205,13 +223,13 @@ if ($tripwiresettings{'ACTION'} eq 'keyreset')
print <
-
$Lang::tr{'keyreset'}
+
$Lang::tr{'keyreset'}
$Lang::tr{'tripwirewarningkeys'}
- $Lang::tr{'ok'}
+ $Lang::tr{'ok'}
- $Lang::tr{'cancel'}
+ $Lang::tr{'cancel'}
@@ -224,13 +242,13 @@ if ($tripwiresettings{'ACTION'} eq 'generatekeys')
print <
-
$Lang::tr{'generatekeys'}
+
$Lang::tr{'generatekeys'}
$Lang::tr{'tripwirewarningkeys'}
- $Lang::tr{'ok'}
+ $Lang::tr{'ok'}
- $Lang::tr{'cancel'}
+ $Lang::tr{'cancel'}
@@ -243,7 +261,7 @@ END
if ($tripwiresettings{'ACTION'} eq 'globalresetyes')
{
-&Header::openbox( 'Waiting', 1, "" );print "