From 786f2c8a296f053a6db934993a0611f1dadb8db5 Mon Sep 17 00:00:00 2001 From: ms Date: Sun, 25 Mar 2007 04:05:41 +0000 Subject: [PATCH] Firewallhitgraphs gefixt. Colours.txt fehlt noch fuer unseren Style. ...und wieder einige Sprachfixes. git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@457 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- config/menu/20-status.menu | 22 +- config/rootfiles/common/GD-TextUtil | 9 + config/rootfiles/common/apache2 | 8 +- config/rootfiles/common/configroot | 3 + config/rootfiles/common/misc-progs | 3 + doc/language_issues.de | 6 - doc/language_issues.en | 6 - doc/language_missings | 1 - doc/packages-list.txt | 2 +- html/cgi-bin/backup.cgi | 652 ---------------------- html/cgi-bin/base.cgi | 488 ---------------- html/cgi-bin/index.cgi | 21 +- html/cgi-bin/logs.cgi/colours.txt | 12 + html/cgi-bin/logs.cgi/firewalllogip.dat | 9 +- html/cgi-bin/logs.cgi/firewalllogport.dat | 9 +- html/cgi-bin/uptime.cgi | 154 ----- langs/de/install/lang_de.c | 4 +- lfs/GD-TextUtil | 79 +++ lfs/configroot | 10 +- make.sh | 1 + tools/check_strings.pl | 1 + 21 files changed, 158 insertions(+), 1342 deletions(-) create mode 100644 config/rootfiles/common/GD-TextUtil delete mode 100644 html/cgi-bin/backup.cgi delete mode 100644 html/cgi-bin/base.cgi create mode 100644 html/cgi-bin/logs.cgi/colours.txt delete mode 100644 html/cgi-bin/uptime.cgi create mode 100644 lfs/GD-TextUtil diff --git a/config/menu/20-status.menu b/config/menu/20-status.menu index f9eddb72d9..9c15b974b1 100644 --- a/config/menu/20-status.menu +++ b/config/menu/20-status.menu @@ -4,57 +4,51 @@ 'title' => "$tr{'sssystem status'}", 'enabled' => 1, }; - $substatus->{'20.networkstatus'} = { - 'caption' => $tr{'ssnetwork status'}, - 'uri' => '/cgi-bin/netstatus.cgi', - 'title' => "$tr{'ssnetwork status'}", - 'enabled' => 1, - }; - $substatus->{'30.systemgraphs'} = { + $substatus->{'20.systemgraphs'} = { 'caption' => $tr{'system graphs'}, 'uri' => '/cgi-bin/graphs.cgi', 'novars' => 1, 'title' => "$tr{'system graphs'}", 'enabled' => 1, }; - $substatus->{'40.trafficgraphs'} = { + $substatus->{'30.trafficgraphs'} = { 'caption' => $tr{'sstraffic graphs'}, 'uri' => '/cgi-bin/graphs.cgi', 'vars' => 'graph=network', 'title' => "$tr{'sstraffic graphs'}", 'enabled' => 1, }; - $substatus->{'50.proxygraphs'} = { + $substatus->{'40.proxygraphs'} = { 'caption' => $tr{'ssproxy graphs'}, 'uri' => '/cgi-bin/proxygraphs.cgi', 'title' => "$tr{'ssproxy graphs'}", 'enabled' => 1, }; - $substatus->{'60.fwhits'} = { + $substatus->{'50.fwhits'} = { 'caption' => 'Firewall-Diagramme', 'uri' => '/cgi-bin/fwhits.cgi', 'title' => "Firewall-Diagramme", 'enabled' => 1, }; - $substatus->{'70.hardwaregraphs'} = { + $substatus->{'60.hardwaregraphs'} = { 'caption' => "$tr{'hardware graphs'}", 'uri' => '/cgi-bin/hardwaregraphs.cgi', 'title' => "$tr{'hardware graphs'}", 'enabled' => 1, }; - $substatus->{'80.connections'} = { + $substatus->{'70.connections'} = { 'caption' => $tr{'connections'}, 'uri' => '/cgi-bin/connections.cgi', 'title' => "$tr{'connections'}", 'enabled' => 1, }; - $substatus->{'90.nettraf'} = { + $substatus->{'80.nettraf'} = { 'caption' => $tr{'sstraffic'}, 'uri' => '/cgi-bin/traffic.cgi', 'title' => "$tr{'sstraffic'}", 'enabled' => 1, }; - $substatus->{'99.iptable'} = { + $substatus->{'90.iptable'} = { 'caption' => $tr{'iptable rules'}, 'uri' => '/cgi-bin/iptables.cgi', 'title' => "$tr{'iptable rules'}", diff --git a/config/rootfiles/common/GD-TextUtil b/config/rootfiles/common/GD-TextUtil new file mode 100644 index 0000000000..e38fb6c3f8 --- /dev/null +++ b/config/rootfiles/common/GD-TextUtil @@ -0,0 +1,9 @@ +#usr/lib/perl5/site_perl/5.8.8/GD/Text +usr/lib/perl5/site_perl/5.8.8/GD/Text.pm +usr/lib/perl5/site_perl/5.8.8/GD/Text/Align.pm +usr/lib/perl5/site_perl/5.8.8/GD/Text/Wrap.pm +#usr/lib/perl5/site_perl/5.8.8/i586-linux/auto/GD/Text +#usr/lib/perl5/site_perl/5.8.8/i586-linux/auto/GD/Text/.packlist +#usr/share/man/man3/GD::Text.3 +#usr/share/man/man3/GD::Text::Align.3 +#usr/share/man/man3/GD::Text::Wrap.3 diff --git a/config/rootfiles/common/apache2 b/config/rootfiles/common/apache2 index 9ef40d3065..70c49027bd 100644 --- a/config/rootfiles/common/apache2 +++ b/config/rootfiles/common/apache2 @@ -1261,8 +1261,6 @@ srv/web/ipfire/cgi-bin/aliases.cgi #srv/web/ipfire/cgi-bin/asterisk.cgi/calls #srv/web/ipfire/cgi-bin/asterisk.cgi/conf #srv/web/ipfire/cgi-bin/asterisk.cgi/status -#srv/web/ipfire/cgi-bin/backup.cgi -#srv/web/ipfire/cgi-bin/base.cgi srv/web/ipfire/cgi-bin/changepw.cgi srv/web/ipfire/cgi-bin/chpasswd.cgi srv/web/ipfire/cgi-bin/connections.cgi @@ -1287,11 +1285,16 @@ srv/web/ipfire/cgi-bin/index.cgi srv/web/ipfire/cgi-bin/ipinfo.cgi srv/web/ipfire/cgi-bin/iptables.cgi srv/web/ipfire/cgi-bin/logs.cgi +#srv/web/ipfire/cgi-bin/logs.cgi/colours.txt #srv/web/ipfire/cgi-bin/logs.cgi/config.dat #srv/web/ipfire/cgi-bin/logs.cgi/firewalllog.dat +#srv/web/ipfire/cgi-bin/logs.cgi/firewalllogip.dat +#srv/web/ipfire/cgi-bin/logs.cgi/firewalllogport.dat #srv/web/ipfire/cgi-bin/logs.cgi/ids.dat #srv/web/ipfire/cgi-bin/logs.cgi/log.dat #srv/web/ipfire/cgi-bin/logs.cgi/proxylog.dat +#srv/web/ipfire/cgi-bin/logs.cgi/showrequestfromip.dat +#srv/web/ipfire/cgi-bin/logs.cgi/showrequestfromport.dat #srv/web/ipfire/cgi-bin/logs.cgi/summary.dat #srv/web/ipfire/cgi-bin/logs.cgi/urlfilter.dat srv/web/ipfire/cgi-bin/modem.cgi @@ -1320,7 +1323,6 @@ srv/web/ipfire/cgi-bin/traffics.cgi srv/web/ipfire/cgi-bin/updatexlrator.cgi srv/web/ipfire/cgi-bin/upload.cgi srv/web/ipfire/cgi-bin/upnp.cgi -#srv/web/ipfire/cgi-bin/uptime.cgi srv/web/ipfire/cgi-bin/urlfilter.cgi srv/web/ipfire/cgi-bin/vpnmain.cgi srv/web/ipfire/cgi-bin/wakeonlan.cgi diff --git a/config/rootfiles/common/configroot b/config/rootfiles/common/configroot index d799dc8035..bb1d59a143 100644 --- a/config/rootfiles/common/configroot +++ b/config/rootfiles/common/configroot @@ -45,6 +45,9 @@ var/ipfire/extrahd/devices var/ipfire/extrahd/partitions var/ipfire/extrahd/scan var/ipfire/extrahd/settings +var/ipfire/fwlogs +#var/ipfire/fwlogs/ipsettings +#var/ipfire/fwlogs/portsettings var/ipfire/general-functions.pl var/ipfire/header.pl var/ipfire/isdn diff --git a/config/rootfiles/common/misc-progs b/config/rootfiles/common/misc-progs index b5a0615306..766591bff0 100644 --- a/config/rootfiles/common/misc-progs +++ b/config/rootfiles/common/misc-progs @@ -1,3 +1,4 @@ +usr/local/bin/extrahdctrl usr/local/bin/getipstat #usr/local/bin/installfcdsl #usr/local/bin/installpackage @@ -21,6 +22,7 @@ usr/local/bin/restartsquid usr/local/bin/restartssh usr/local/bin/restartsyslogd usr/local/bin/restartwireless +#usr/local/bin/sambactrl usr/local/bin/setaliases usr/local/bin/setdate usr/local/bin/setdmzholes @@ -28,3 +30,4 @@ usr/local/bin/setfilters usr/local/bin/setportfw usr/local/bin/setxtaccess usr/local/bin/timecheckctrl +usr/local/bin/upnpctrl diff --git a/doc/language_issues.de b/doc/language_issues.de index aa48be6cd0..910e098443 100644 --- a/doc/language_issues.de +++ b/doc/language_issues.de @@ -46,8 +46,6 @@ WARNING: translation string unused: backup WARNING: translation string unused: backup config floppy WARNING: translation string unused: backup password WARNING: translation string unused: bad characters in -WARNING: translation string unused: bad destination range -WARNING: translation string unused: bad source range WARNING: translation string unused: blue access WARNING: translation string unused: blue access use hint WARNING: translation string unused: blue interface @@ -62,7 +60,6 @@ WARNING: translation string unused: comment WARNING: translation string unused: compression WARNING: translation string unused: connect WARNING: translation string unused: connect the modem -WARNING: translation string unused: connected WARNING: translation string unused: could not connect to WARNING: translation string unused: could not connect to www ipcop org WARNING: translation string unused: could not create directory @@ -82,7 +79,6 @@ WARNING: translation string unused: ddns help dnsmadeeasy WARNING: translation string unused: ddns help freedns WARNING: translation string unused: ddns help plus WARNING: translation string unused: debugme -WARNING: translation string unused: destination port numbers WARNING: translation string unused: dhcp base ip fixed lease WARNING: translation string unused: dhcp create fixed leases WARNING: translation string unused: dhcp fixed lease err1 @@ -127,7 +123,6 @@ WARNING: translation string unused: host configuration WARNING: translation string unused: hostname and domain already in use WARNING: translation string unused: hours2 WARNING: translation string unused: id -WARNING: translation string unused: idle WARNING: translation string unused: idle cpu WARNING: translation string unused: idle cpu usage WARNING: translation string unused: ids logs @@ -224,7 +219,6 @@ WARNING: translation string unused: sectors read from disk per second WARNING: translation string unused: sectors written to disk per second WARNING: translation string unused: select media WARNING: translation string unused: shared memory -WARNING: translation string unused: source port numbers WARNING: translation string unused: squid extension methods WARNING: translation string unused: squid extension methods invalid WARNING: translation string unused: squid fix cache diff --git a/doc/language_issues.en b/doc/language_issues.en index 4235040ad2..902f473748 100644 --- a/doc/language_issues.en +++ b/doc/language_issues.en @@ -48,8 +48,6 @@ WARNING: translation string unused: backup WARNING: translation string unused: backup archive WARNING: translation string unused: backup config floppy WARNING: translation string unused: backup erase key -WARNING: translation string unused: bad destination range -WARNING: translation string unused: bad source range WARNING: translation string unused: bewan adsl pci st WARNING: translation string unused: bewan adsl usb WARNING: translation string unused: blue access @@ -65,7 +63,6 @@ WARNING: translation string unused: comment WARNING: translation string unused: compression WARNING: translation string unused: connect WARNING: translation string unused: connect the modem -WARNING: translation string unused: connected WARNING: translation string unused: could not connect to WARNING: translation string unused: could not connect to www ipfire org WARNING: translation string unused: could not create directory @@ -82,7 +79,6 @@ WARNING: translation string unused: current profile WARNING: translation string unused: daily firewallhits WARNING: translation string unused: dat without key WARNING: translation string unused: debugme -WARNING: translation string unused: destination port numbers WARNING: translation string unused: dhcp server disabled on blue interface WARNING: translation string unused: dhcp server enabled on blue interface WARNING: translation string unused: dialup settings @@ -124,7 +120,6 @@ WARNING: translation string unused: host configuration WARNING: translation string unused: hostname and domain already in use WARNING: translation string unused: hours2 WARNING: translation string unused: id -WARNING: translation string unused: idle WARNING: translation string unused: idle cpu WARNING: translation string unused: idle cpu usage WARNING: translation string unused: ids logs @@ -216,7 +211,6 @@ WARNING: translation string unused: sectors read from disk per second WARNING: translation string unused: sectors written to disk per second WARNING: translation string unused: shaping add options WARNING: translation string unused: shared memory -WARNING: translation string unused: source port numbers WARNING: translation string unused: squid extension methods WARNING: translation string unused: squid extension methods invalid WARNING: translation string unused: ssdmz pinholes diff --git a/doc/language_missings b/doc/language_missings index a10de8d5c1..b2126a5254 100644 --- a/doc/language_missings +++ b/doc/language_missings @@ -1,7 +1,6 @@ ############################################################################ # Checking install/setup translations for language: en # ############################################################################ -< TR_INSTALLING_LANG_CACHE ############################################################################ # Checking cgi-bin translations for language: en # ############################################################################ diff --git a/doc/packages-list.txt b/doc/packages-list.txt index 4ef3fc036d..2c6601309d 100644 --- a/doc/packages-list.txt +++ b/doc/packages-list.txt @@ -11,6 +11,7 @@ * Digest-SHA1-2.10 * GD-2.35 * GDGraph-1.4308 +* GDTextUtil-0.86 * Geo-IP-PurePerl-1.17 * HTML-Parser-3.45 * HTML-Tagset-3.04 @@ -118,7 +119,6 @@ * ipp2p-0.8.2-iptables * iproute2-2.6.16-060323 * iptables-1.3.5 -* iptables-1.3.7 * iptraf-3.0.0 * iptstate-2.1 * iputils-ss020927 diff --git a/html/cgi-bin/backup.cgi b/html/cgi-bin/backup.cgi deleted file mode 100644 index 0948b7751a..0000000000 --- a/html/cgi-bin/backup.cgi +++ /dev/null @@ -1,652 +0,0 @@ -#!/usr/bin/perl -# -# IPFire CGI's - backup.cgi: manage import/export of configuration files -# -# This code is distributed under the terms of the GPL -# -# (c) The IPFire Team -# 2005 Franck Bourdonnec, major rewrite -# -# $Id: backup.cgi,v 1.2.2.15 2006/01/29 15:31:49 eoberlander Exp $ -# -# - - -# to fully troubleshot your code, uncomment diagnostics, Carp and cluck lines -# use diagnostics; # need to add the file /usr/lib/perl5/5.8.x/pods/perldiag.pod before to work -# next look at /var/log/httpd/error_log , http://www.perl.com/pub/a/2002/05/07/mod_perl.html may help -#use warnings; -use strict; -#use Carp (); -#local $SIG{__WARN__} = \&Carp::cluck; -use File::Copy; -use Sys::Hostname; - -require '/var/ipfire/general-functions.pl'; -require "${General::swroot}/lang.pl"; -require "${General::swroot}/header.pl"; - -my $errormessage = ''; -my $warnmessage = ''; -my $setdir = '/home/httpd/html/backup'; # location where sets are stored and imported -my $datafile = hostname() . '.dat'; # file containing data backup -my $datefile = $datafile . '.time'; # and creation date - -# ask if backup crypting key exists -my $tmpkeyfile = "$setdir/key"; # import the backup key - -# Get GUI values -my %settings = (); -&Header::getcgihash(\%settings, {'wantfile' => 1, 'filevar' => 'FH'}); - -## -## Backup key management -## - -# -# Export the key. root pw is required to avoid user 'noboby' uses the helper to read it and creates -# fake backup. -# -if ($settings{'ACTION'} eq $Lang::tr{'backup export key'}) { - - my $size = 0; - if ($settings{'PASSWORD1'} ne '' && $settings{'PASSWORD1'} ne $settings{'PASSWORD2'} ){ - $errormessage = $Lang::tr{'passwords do not match'} - } else { - my @lines = `/usr/local/bin/ipfirebackup -keycat $settings{'PASSWORD'}`; - # If previous operation succeded and the key need to be crypted, redo operation with pipe to openssl - if (@lines && $settings{'PASSWORD1'}) { - @lines = `/usr/local/bin/ipfirebackup -keycat $settings{'PASSWORD'}|openssl enc -a -e -aes256 -salt -pass pass:$settings{'PASSWORD1'} `; - } - if (@lines) { - use bytes; - foreach (@lines) {$size += length($_)}; - print "Pragma: no-cache\n"; - print "Cache-control: no-cache\n"; - print "Connection: close\n"; - print "Content-type: application/octet-stream\n"; - print "Content-Disposition: filename=backup.key\n"; - print "Content-Length: $size\n\n"; - print @lines; - exit (0); - } else { - $errormessage = $Lang::tr{'incorrect password'}; - } - } -} -# -# Import the key. Fail if key exists. This avoid creating fake backup. -# -if ($settings{'ACTION'} eq $Lang::tr{'backup import key'}) { - if (ref ($settings{'FH'}) ne 'Fh') { - $errormessage = $Lang::tr{'no cfg upload'}; - } else { - if (copy ($settings{'FH'}, $tmpkeyfile) != 1) { - $errormessage = $Lang::tr{'save error'}; - } else { - # if a password is given, decrypt the key received in $tmpkeyfile file with it. - # no error is produce if the password is wrong. - if ($settings{'PASSWORD1'}) { - my @lines = `openssl enc -a -d -aes256 -salt -pass pass:$settings{'PASSWORD1'} -in $tmpkeyfile`; - open(FILE,">$tmpkeyfile"); - print FILE @lines; - close (FILE); - } - $errormessage = &get_bk_error(system ('/usr/local/bin/ipfirebackup -key import')>>8); - } - } -} -# -# Import the key. Fail if key exists. Key is extracted from a non-encrypted backup (pre 1.4.10) -# -if ($settings{'ACTION'} eq $Lang::tr{'backup extract key'}) { - if (ref ($settings{'FH'}) ne 'Fh') { - $errormessage = $Lang::tr{'no cfg upload'}; - } else { - if (copy ($settings{'FH'}, '/tmp/tmptarfile.tgz') != 1) { - $errormessage = $Lang::tr{'save error'}; - } else { - system( "tar -C /tmp -xzf /tmp/tmptarfile.tgz */backup/backup.key;\ - mv -f /tmp${General::swroot}/backup/backup.key $tmpkeyfile;\ - rm -rf /tmp${General::swroot};\ - rm /tmp/tmptarfile.tgz"); - $errormessage = &get_bk_error(system ('/usr/local/bin/ipfirebackup -key import')>>8); - } - } -} -# -# Create the key. Cannot overwrite existing key to avoid difference with exported (saved) key -# -if ($settings{'ACTION'} eq $Lang::tr{'backup generate key'}) { - $errormessage = &get_bk_error(system('/usr/local/bin/ipfirebackup -key new')>>8); -} - -my $cryptkeymissing = system ('/usr/local/bin/ipfirebackup -key exist')>>8; - -&Header::showhttpheaders(); -if ($cryptkeymissing) { #If no key is present, force creation or import - &Header::openpage($Lang::tr{'backup configuration'}, 1, ''); - &Header::openbigbox('100%', 'left', '', $errormessage); - if ($errormessage) { - &Header::openbox('100%', 'left', $Lang::tr{'error messages'}); - print "$errormessage "; - &Header::closebox(); - } - &Header::openbox('100%', 'left', $Lang::tr{'backup key'}); - print < - - - - - - - - - - - -
- $Lang::tr{'backup explain key'}: -
    -
  • $Lang::tr{'backup explain key li1'} -
  • $Lang::tr{'backup explain key li2'} -
  • $Lang::tr{'backup explain key li3'} -
-
- -
$Lang::tr{'backup key file'}: - - -
$Lang::tr{'backup protect key password'}: -
$Lang::tr{'backup clear archive'}: - - -
- $Lang::tr{'notes'}: - - -END -; - &floppybox(); - &Header::closebox(); - &Header::closebigbox(); - &Header::closepage(); - exit (0); -} - -## -## Sets management (create/delete/import/restore) -## - -erase_files ($setdir); #clean up - -# -# create new archive set -# -if ($settings{'ACTION'} eq $Lang::tr{'create'}) { - $errormessage = &get_bk_error(system('/usr/local/bin/ipfirebkcfg > /dev/null')>>8); - &import_set (" ".&Header::cleanhtml ($settings{'COMMENT'})) if (!$errormessage); -} -# -# delete a backup set -# -if ($settings{'ACTION'} eq $Lang::tr{'remove'}) { - erase_files (&Header::cleanhtml ($settings{'KEY'})); # remove files - rmdir($settings{'KEY'}); # remove directory -} -# -# import an archive set -# -if ($settings{'ACTION'} eq $Lang::tr{'import'}) { - if (ref ($settings{'FH'}) ne 'Fh') { - $errormessage = $Lang::tr{'no cfg upload'}; - } else { - if (!copy ($settings{'FH'}, "$setdir/$datafile")) { - $errormessage = $Lang::tr{'save error'}; - } else { - &import_set (' (imported)'); - } - } -} -# -# restore an archive -# -if ($settings{'ACTION'} eq $Lang::tr{'restore'}) { - if ($settings{'AreYouSure'} eq 'yes') { - if (!$cryptkeymissing) { # if keyfile exists - if (-e "$settings{'KEY'}/$datafile"){ # encrypted dat is required - copy_files($settings{'KEY'}, $setdir); # to working dir - $errormessage = get_rs_error(system("/usr/local/bin/ipfirerscfg" - . ($settings{'RESTOREHW'} eq 'on' ? ' --hardware' : '') - . ' >/dev/null')>>8); - if (!$errormessage) { - # restored ok, recommend restarting system - $warnmessage = $Lang::tr{'cfg restart'}; - } - erase_files ($setdir); #clean up - } else { - $errormessage = $Lang::tr{'missing dat'}."$settings{'KEY'}/$datafile"; - } - } else { # if keyfile does not exist - $errormessage = $Lang::tr{'backup missing key'}; - } - - } else { # not AreYouSure=yes - &Header::openpage($Lang::tr{'backup configuration'}, 1, ''); - &Header::openbigbox('100%', 'left'); - &Header::openbox('100%', 'left', $Lang::tr{'are you sure'}); - print < - - - - - - - - -
- - - -
- $Lang::tr{'restore hardware settings'}: -
- -END -; - &Header::closebox(); - &Header::closebigbox(); - &Header::closepage(); - exit (0); - } -} -## -## Media management -## -# -# now build the list of removable device -# - -# Read partitions sizes registered with the system -my %partitions; -foreach my $li (`/usr/local/bin/ipfirebackup -proc partitions`) { # use suid helper... - # partitions{'sda1'} = 128M if /major minor blocks name/ - $partitions{$4} = &kmgt($3*1024,4) if ($li =~ /(\d+) +(\d+) +(\d+) +(.*)/); -} - -# Search usb-storage scsi device -my %medias; - -foreach (`/usr/local/bin/ipfirebackup -glob '/proc/scsi/usb-storage*/*'`) {# use suid helper... - my $m; - foreach ( `cat $_` ) { # list each line of information for the device: -# Host scsi0: usb-storage -# Vendor: SWISSBIT -# Product: Black Silver -# Serial Number: D0ED423A4F84A31E -# Protocol: Transparent SCSI -# Transport: Bulk -# GUID: 13706828d0ed423a4f84a31e -# Attached: Yes - - chomp; - my ($key,$val) = split(': ',$_,2); - $key =~ s/^ *//; # remove front space - - # convert 'scsi?' key to sda, sdb,... and use it as a %medias keyhash - if ($key =~ /Host scsi(.)/) { - $val = $m = 'sd' . chr(97+$1); - $key = 'Host'; - } - $medias{$m}{$key} = $val; # save data - } -} - -# -# Switch mounted media -# -if ($settings{'ACTION'} eq $Lang::tr{'mount'}) -{ - # Find what is really mounted under backup. Can be local hard disk or any removable media - my $mounted = &findmounted(); - #umount previous, even if same device already mouted. - system ("/usr/local/bin/ipfirebackup -U $mounted") if ($mounted ne $Lang::tr{'local hard disk'}); - $errormessage = `/usr/local/bin/ipfirebackup -M $settings{'SELECT'}` if (grep (/$settings{'SELECT'}/,%partitions)); -} -# -# Compute a full description of device -# -my $mounted = &findmounted(); -my $media_des = $mounted; # Description -if ($mounted ne $Lang::tr{'local hard disk'}) { - $_ = $mounted; # sda1 => sda - tr/0-9//d; - $media_des = "$medias{$_}{'Product'} ($media_des, $partitions{$mounted})"; -} -&Header::openpage($Lang::tr{'backup configuration'}, 1, ''); -&Header::openbigbox('100%', 'left', '', $errormessage); - -if ($errormessage) { - &Header::openbox('100%', 'left', $Lang::tr{'error messages'}); - print "$errormessage "; - &Header::closebox(); -} - -$warnmessage = "$Lang::tr{'capswarning'}: $warnmessage

" if ($warnmessage); - -&Header::openbox('100%', 'left', $Lang::tr{'backup configuration'}); - -#Divide the window in two : left and right -print < - - $Lang::tr{'current media'}:$media_des - - $Lang::tr{'choose media'} - -END -; - -# Left part of window -print < -

    -
  • $Lang::tr{'backup sets'}: - - - - - -END -; - -# get list of available sets by globbing directories under $setdir -# External device (usk key) are mounted in $setdir. -R permits finding sets in hierarchy. -my $i = 0; -foreach my $set (`ls -Rt1 $setdir`) { - chop ($set); #remove ':' & newline from line - chop ($set); - if (-d $set && ($set =~ m!/.+/\d{8}_\d{6}! ) ) { # filter out things not sets ! - if ($i++ % 2) { - print ""; - } else { - print ""; - } - my $settime = read_timefile( "$set/$datefile", "$set/$datafile" ); - my $name = substr ($set,length($setdir)+1); - print< - $settime - - - - - - - - -EOF -; - } -} -print "
    $Lang::tr{'name'}$Lang::tr{'action'}
    -
    - - - -
    -
    - - -
    - - - -
    -
    " . ($i ? "
    " : "$Lang::tr{'empty'}!

    "); -print < -
  • $Lang::tr{'backup configuration'}
    - $Lang::tr{'description'}: - -

    -

    -
  • $Lang::tr{'backup import dat file'}:
    - - -
  • -
-EOF -; - -print ""; # Start right part (devices selection) -print $Lang::tr{'backup media info'}; - -print "
"; -print "
"; -my $nodev = 1; # nothing present -foreach my $media (keys %medias) { - if ( $medias{$media}{'Attached'} eq 'Yes') { # device is attached to USB bus ? - $nodev = 0; # at least one device present - my $checked = $medias{$media}{'Host'} eq $mounted ? "checked='checked'" : ''; - print ""; - print "$medias{$media}{'Product'}
"; - # list attached partitions to this media - foreach my $part (sort (keys (%partitions))) { - if ($part =~ /$medias{$media}{'Host'}./) { - my $checked = $part eq $mounted ? "checked='checked'" : ''; - print "   $part ($partitions{$part})
"; - } - } - } -} -if ($nodev) { - print "
$Lang::tr{'insert removable device'}"; - print "
"; - print "
"; -} else { - #Add an entry for the local disk - my $checked = $Lang::tr{'local hard disk'} eq $mounted ? "checked='checked'" : ''; - print ""; - print "$Lang::tr{'local hard disk'}"; - print "
"; - print "
"; -} -print "
"; -print "
"; -# -#Backup key -# -print< -
- $Lang::tr{'backup key'}
- $Lang::tr{'backup key info'}
- - - -
$Lang::tr{'root user password'}: - - -
$Lang::tr{'backup protect key password'}: - -
$Lang::tr{'again'} - -
-
- -EOF -; -# End of right table -print ""; - -&floppybox(); - -&Header::closebox(); -&Header::closebigbox(); -&Header::closepage(); - -sub floppybox { - print < -
- - - - - - - - -
- $Lang::tr{'backup to floppy'} -
- $Lang::tr{'insert floppy'} - - -
-
-END -; - print "$Lang::tr{'alt information'}
" .
-    	    `/usr/local/bin/ipfirebackup -savecfg floppy` .
-	    ' 
' if ($settings{'ACTION'} eq $Lang::tr{'backup to floppy'} ); -} - -# Return device name of what is mounted under 'backup' -sub findmounted() { - my $mounted = `mount|grep ' /home/httpd/html/backup '`; - if ($mounted) { # extract device name - $mounted =~ m!^/dev/(.*) on!; # device on mountmoint options - return $1; - } else { # it's the normal subdir - return $Lang::tr{'local hard disk'}; - } -} -# read and return a date/time string from a time file -sub read_timefile() { - my $fname = shift; # name of file to read from - my $fname2 = shift; # if first file doesn't exist, get date of this file - - my $dt; - if (defined(open(FH, "<$fname"))) { - $dt = ; - chomp $dt; - close(FH); - } else { - $dt = &get_fdate($fname2); # get file date/time - write_timefile($fname, $dt); # write to expected time file - } - return $dt; -} -# write a date/time string to a time file -sub write_timefile() { - my $fname = shift; # name of file to write to - my $dt = shift; # date/time string to write - - if (open(FH, ">$fname")) { - print FH "$dt\n"; - close(FH); - } -} -# move a dat file without time stamp to subdir -sub import_set() { - my $dt = get_fdate("$setdir/$datafile") . shift; - &write_timefile("$setdir/$datefile", $dt); - - # create set directory - my $setname = "$setdir/" . get_ddate("$setdir/$datafile"); - mkdir($setname); - - # move files to the new set directory - copy_files($setdir, $setname); - erase_files ($setdir); -} - -# get date/time string from file -sub get_fdate() { - my $fname = shift; - open(DT, "/bin/date -r $fname|"); - my $dt =
; - close(DT); - chomp $dt; - $dt =~ s/\s+/ /g; # remove duplicate spaces - return $dt; -} -# get date/time string from file for use as directory name -sub get_ddate() { - my $fname = shift; - open(DT, "/bin/date -r $fname +%Y%m%d_%H%M%S|"); - my $dt =
; - close(DT); - chomp $dt; - return $dt; -} -# copy archive files from source directory to destination directory -sub copy_files() { - my $src_dir = shift; - my $dest_dir = shift; - map (copy ("$src_dir/$_", "$dest_dir/$_"), ($datafile, $datefile) ); -} -# erase set files -sub erase_files() { - my $src_dir = shift; - map (unlink ("$src_dir/$_"), ($datafile, $datefile)); -} -# get backup error text -sub get_bk_error() { - my $exit_code = shift || return ''; - if ($exit_code == 0) { - return ''; - } elsif ($exit_code == 2) { - return $Lang::tr{'err bk 2 key'}; - } elsif ($exit_code == 3) { - return $Lang::tr{'err bk 3 tar'}; - } elsif ($exit_code == 4) { - return $Lang::tr{'err bk 4 gz'}; - } elsif ($exit_code == 5) { - return $Lang::tr{'err bk 5 encrypt'}; - } else { - return $Lang::tr{'err bk 1'}; - } -} -# show any restore errors -sub get_rs_error() { - - my $exit_code = shift || return ''; - if ($exit_code == 0) { - return ''; - } elsif ($exit_code == 6) { - return $Lang::tr{'err rs 6 decrypt'}; - } elsif ($exit_code == 7) { - return $Lang::tr{'err rs 7 untartst'}; - } elsif ($exit_code == 8) { - return $Lang::tr{'err rs 8 untar'}; - } elsif ($exit_code == 9) { - return $Lang::tr{'missing dat'}; - } else { - return $Lang::tr{'err rs 1'}."($exit_code)"; - } -} -sub kmgt { - my ($value,$length,$opt_U) = @_; - if ( $value > 10**( $length + 8 ) or $opt_U eq 'T' ) { - return sprintf( "%d%s", int( ( $value / 1024**4 ) + .5 ), 'T' ); - } elsif ( $value > 10**( $length + 5 ) or $opt_U eq 'G' ) { - return sprintf( "%d%s", int( ( $value / 1024**3 ) + .5 ), 'G' ); - } elsif ( $value > 10**( $length + 2 ) or $opt_U eq 'M' ) { - return sprintf( "%d%s", int( ( $value / 1024**2 ) + .5 ), 'M' ); - } elsif ( $value > 10**($length) or $opt_U eq 'K' ) { - return sprintf( "%d%s", int( ( $value / 1024 ) + .5 ), 'K' ); - } else { - return $value; - } -} - -1; diff --git a/html/cgi-bin/base.cgi b/html/cgi-bin/base.cgi deleted file mode 100644 index 57acddd613..0000000000 --- a/html/cgi-bin/base.cgi +++ /dev/null @@ -1,488 +0,0 @@ -#!/usr/bin/perl -# -# IPFire CGI's - base.cgi -# -# This code is distributed under the terms of the GPL -# -# (c) place a name here -# -# $Id: base.cgi,v 1.1.2.10 2005/11/03 19:20:50 franck78 Exp $ -# -# - - -# This file is a starting base for writting a new GUI screen using the three box model -# Box 1 : global settings for the application -# Box 2 : line editor for multiple data line -# Box 3 : the list of data line, with edit/remove buttons -# -# This example do the following -# Read global settings: -# a NAME and an interface (IT) -# Lines of data composed of: -# an ipaddress (IP), an enabled/disabled options (CB), a comment (CO) -# -# -# All you need to do is -# replace 'XY' with your app name -# define your global $settings{'var name'} -# define your strings -# write validation code for Settings1 and Settings2 -# write HTML box Settings1 and Settings2 -# adapt the sort function -# write the correct configuration file -# -# -# to fully troubleshot your code, uncomment diagnostics, Carp and cluck lines -# use diagnostics; # need to add the file /usr/lib/perl5/5.8.x/pods/perldiag.pod before to work -# next look at /var/log/httpd/error_log , http://www.perl.com/pub/a/2002/05/07/mod_perl.html may help -#use warnings; -use strict; -#use Carp (); -#local $SIG{__WARN__} = \&Carp::cluck; - -require '/var/ipfire/general-functions.pl'; # Replace all occurences of with CONFIG_ROOT - # before updating cvs IPFire file. -require "${General::swroot}/lang.pl"; -require "${General::swroot}/header.pl"; - -# Files used -our $setting = "${General::swroot}/XY/settings"; # particular settings -my $datafile = "${General::swroot}/XY/data"; # repeted settings (multilines) -our $conffile = "${General::swroot}/XY/XY.conf"; # Config file for application XY - -# strings to add to languages databases or in addon language file -$Lang::tr{'XY title'} = 'XY service'; -$Lang::tr{'XY settings'} = 'XY setup'; -$Lang::tr{'XY add data'} = 'add data'; -$Lang::tr{'XY edit data'} = 'edit data'; -$Lang::tr{'XY data'} = 'XY data'; - -# informationnal & log strings, no translation required -my $msg_added = 'XY added'; -my $msg_modified = 'XY modified'; -my $msg_deleted = 'XY removed'; -my $msg_datafileerror = 'XY data file error'; -our $msg_configfileerror = 'XY configuration file error'; - -my %settings=(); - -# Settings1 -$settings{'NAME'} = ''; # a string field than must be 'GOOD' or 'good' -$settings{'IT'} = ''; # a 'choose' field for color interface -$settings{'TURBO'} = 'off'; # a checkbox field to enable something - -# Settings2 for editing the multi-line list -# Must not be saved by writehash ! -$settings{'IP'} = ''; # datalines are: IPaddress,enable,comment -$settings{'CB'} = 'off'; # Every check box must be set to off -$settings{'COMMENT'} = ''; -my @nosaved=('IP','CB','COMMENT'); # List here ALL setting2 fields. Mandatory - -$settings{'ACTION'} = ''; # add/edit/remove.... -$settings{'KEY1'} = ''; # point record for ACTION - -# Define each field that can be used to sort columns -my $sortstring='^IP|^COMMENT'; -my $errormessage = ''; -my $warnmessage = ''; - -&Header::showhttpheaders(); - -# Read needed Ipcop settings (exemple) -my %mainsettings=(); -&General::readhash("${General::swroot}/main/settings", \%mainsettings); - -# Get GUI values -&Header::getcgihash(\%settings); - -# Load multiline data. Do it before use in save action -our $f = new Multilines (filename => $datafile, - fields => ['IP','CB','COMMENT'], - comment => 1 - ); - -## -## SAVE Settings1 -## -# Remove if no Settings1 needed -if ($settings{'ACTION'} eq $Lang::tr{'save'}) { - - # - #Validate static Settings1 here - # - if (($settings{"NAME"} ne "GOOD") && - ($settings{"NAME"} ne "good")) { - $errormessage = 'Enter good or GOOD in Name field'; - } - - unless ($errormessage) { # Everything is ok, save settings - map (delete ($settings{$_}) ,(@nosaved,'ACTION','KEY1'));# Must never be saved - &General::writehash($setting, \%settings); # Save good settings - $settings{'ACTION'} = $Lang::tr{'save'}; # Recreate 'ACTION' - map ($settings{$_}= '',(@nosaved,'KEY1')); # and reinit var to empty - - # Rebuild configuration file if needed - &BuildConfiguration; - } - - ERROR: # Leave the faulty field untouched -} else { - &General::readhash($setting, \%settings); # Get saved settings and reset to good if needed -} - -## -## Now manipulate the multiline list with Settings2 -## - -# Basic actions are: -# toggle the check box -# add/update a new line -# begin editing a line -# remove a line -# $KEY1 contains the index of the line manipulated - -## -## Toggle CB field. -## -if ($settings{'ACTION'} eq $Lang::tr{'toggle enable disable'}) { - - $f->togglebyfields($settings{'KEY1'},'CB'); # toggle checkbox - $settings{'KEY1'} = ''; # End edit mode - - &General::log($msg_modified); - - # save changes - $f->savedata || die "$msg_datafileerror"; - - # Rebuild configuration file - &BuildConfiguration; -} - -## -## ADD/UPDATE a line of configuration from Settings2 -## -if ($settings{'ACTION'} eq $Lang::tr{'add'}) { - # Validate inputs - if (! &General::validip($settings{'IP'})) {$errormessage = "Specify an IP value !"}; - if (! $settings{'COMMENT'} ) {$warnmessage = "no comment specified"}; - - unless ($errormessage) { - if ($settings{'KEY1'} eq '') { #add or edit ? - # insert new data line - $f->writedata(-1, $settings{'IP'},$settings{'CB'},$settings{'COMMENT'}); - &General::log($msg_added); - } else { - # modify data line - $f->writedata($settings{'KEY1'}, $settings{'IP'},$settings{'CB'},$settings{'COMMENT'}); - $settings{'KEY1'} = ''; # End edit mode - &General::log($msg_modified); - } - # save changes - $f->savedata || die "$msg_datafileerror"; - - # Rebuild configuration file - &BuildConfiguration; - - # if entering data line is a repetitive task, choose here to not erase fields between each addition - map ($settings{$_}='' ,@nosaved); - } -} - -## -## begin EDIT: move data fields to Settings2 controls -## -if ($settings{'ACTION'} eq $Lang::tr{'edit'}) { - $f->readdata ($settings{'KEY1'}, - $settings{'IP'}, - $settings{'CB'}, - $settings{'COMMENT'}); -} -## -## REMOVE: remove selected line -## -if ($settings{'ACTION'} eq $Lang::tr{'remove'}) { - $f->deleteline ($settings{'KEY1'}); - $settings{'KEY1'} = ''; # End remove mode - &General::log($msg_deleted); - - # save changes - $f->savedata || die "$msg_datafileerror"; - - # Rebuild configuration file - &BuildConfiguration; -} - - -## -## Check if sorting is asked -## -if ($ENV{'QUERY_STRING'} =~ /$sortstring/ ) { - my $newsort=$ENV{'QUERY_STRING'}; - my $actual=$settings{'SORT_XY'}; - - # Reverse actual sort or choose new column ? - if ($actual =~ $newsort) { - $f->setsortorder ($newsort ,rindex($actual,'Rev')); - $newsort .= rindex($actual,'Rev')==-1 ? 'Rev' : ''; - } else { - $f->setsortorder ($newsort ,1); - } - $f->savedata; # Synchronise file & display - $settings{'SORT_XY'} = $newsort; - map (delete ($settings{$_}) ,(@nosaved,'ACTION','KEY1')); # Must never be saved - &General::writehash($setting, \%settings); - $settings{'ACTION'} = 'SORT'; # Recreate an 'ACTION' - map ($settings{$_}= '',(@nosaved,,'KEY1')); # and reinit var to empty -} - -## -## Remove if no Setting1 needed -## -if ($settings{'ACTION'} eq '' ) { # First launch from GUI - # Place here default value when nothing is initialized - -} - -&Header::openpage($Lang::tr{'XY title'}, 1, ''); -&Header::openbigbox('100%', 'left', '', $errormessage); -my %checked =(); # Checkbox manipulations - -if ($errormessage) { - &Header::openbox('100%', 'left', $Lang::tr{'error messages'}); - print "$errormessage "; - &Header::closebox(); -} - -## -## First box Settings1. Remove if not needed -## -$warnmessage = "$Lang::tr{'capswarning'}: $warnmessage" if ($warnmessage); - -&Header::openbox('100%', 'left', $Lang::tr{'XY settings'}); -print "
"; -$checked{'IT'}{'RED'} = ''; -$checked{'IT'}{'GREEN'} = ''; -$checked{'IT'}{'ORANGE'} = ''; -$checked{'IT'}{'BLUE'} = ''; -$checked{'IT'}{$settings{'IT'}} = "checked='checked'"; -$checked{'TURBO'} = ($settings{'TURBO'} eq 'on') ? "checked='checked'" : ''; - -print< - - Name: - - INTERFACE - red - - Turbo: - - - green - - - - - blue - - - - - orange - - -
-END -; - -print< -
- - * $Lang::tr{'this field may be blank'} - $warnmessage - - - - -END -; -&Header::closebox(); # end of Settings1 - -## -## Second box is for editing the an item of the list -## -$checked{'CB'} = ($settings{'CB'} eq 'on') ? "checked='checked'" : ''; - -my $buttontext = $Lang::tr{'add'}; -if ($settings{'KEY1'} ne '') { - $buttontext = $Lang::tr{'update'}; - &Header::openbox('100%', 'left', $Lang::tr{'XY edit data'}); -} else { - &Header::openbox('100%', 'left', $Lang::tr{'XY add data'}); -} - -# Edited line number (KEY1) passed until cleared by 'save' or 'remove' or 'new sort order' -print < - - - - - - - - - - -
$Lang::tr{'ip address'}:$Lang::tr{'enabled'}$Lang::tr{'remark'}: *
-
- - - - - -
* $Lang::tr{'this field may be blank'}
- -END -; -&Header::closebox(); - -## -## Third box shows the list -## - -# Columns headers may be a sort link. In this case it must be named in $sortstring -&Header::openbox('100%', 'left', $Lang::tr{'XY data'}); -print < - - $Lang::tr{'ip address'} - $Lang::tr{'remark'} - $Lang::tr{'action'} - -END -; - -## -## Print each line of @current list -## -my $key = 0; -$f->readreset; # beginning of data -for ($key=0; $key<$f->getnumberofline; $key++) { - - my($cb,$comment,$ip) = $f->readbyfieldsseq($key,'CB','COMMENT','IP'); - - #Choose icon for checkbox - my $gif = ''; - my $gdesc = ''; - if ($cb eq "on") { - $gif = 'on.gif'; - $gdesc = $Lang::tr{'click to disable'}; - } else { - $gif = 'off.gif'; - $gdesc = $Lang::tr{'click to enable'}; - } - - #Colorize each line - if ($settings{'KEY1'} eq $key) { - print ""; - } elsif ($key % 2) { - print ""; - } else { - print ""; - } - - print <$ip -$comment - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - -END -; -} print ""; - -# If table contains entries, print 'Key to action icons' -if ($key) { -print < - -  $Lang::tr{'legend'}:  - $Lang::tr{ - $Lang::tr{'click to disable'} -    - $Lang::tr{ - $Lang::tr{'click to enable'} -    - $Lang::tr{ - $Lang::tr{'edit'} -    - $Lang::tr{ - $Lang::tr{'remove'} - - -END -; -} - -&Header::closebox(); -&Header::closebigbox(); -&Header::closepage(); - -## Ouf it's the end ! - -## -## Build the configuration file for application XY -## -sub BuildConfiguration { - open(FILE, ">/$conffile") or die "$msg_configfileerror"; - flock(FILE, 2); - - #Global settings - print FILE "#\n# Configuration file for application XY\n#\n\n"; - print FILE "# do not edit manually\n"; - print FILE "# build for Ipcop:$mainsettings{'HOSTNAME'}\n\n\n"; - print FILE "service=$settings{'NAME'}\n"; - print FILE "activate-turbo\n" if $settings{'TURBO'} eq 'on'; - print FILE "interface=$settings{'IT'}\n\n\n"; - #write data line - { - my ($IP,$CB,$COMMENT); - $f->readreset; - while (defined ($f->readdataseq($IP,$CB,$COMMENT))) { - if ($CB eq "on") { - print FILE "$IP\t\t\t\t\t#$COMMENT\n"; - } else { - print FILE "#DISABLED $IP\t\t\t\t#$COMMENT\n"; - } - } - } - close FILE; - - # Restart service - #system '/usr/local/bin/restartyourhelper'; -} diff --git a/html/cgi-bin/index.cgi b/html/cgi-bin/index.cgi index 6e85043ca4..c984300e48 100644 --- a/html/cgi-bin/index.cgi +++ b/html/cgi-bin/index.cgi @@ -10,8 +10,8 @@ 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"; @@ -74,7 +74,7 @@ if ( ( $pppsettings{'VALID'} eq 'yes' && $modemsettings{'VALID'} eq 'yes' ) || ( chomp ($ipaddr); } if (open(IPADDR,"${General::swroot}/red/local-ipaddress")) { - my $ipaddr = ; + $ipaddr = ; close IPADDR; chomp ($ipaddr); } @@ -136,6 +136,21 @@ END print "$Lang::tr{'profile has errors'}\n \n"; } + my $HOSTNAME = (gethostbyaddr(pack("C4", split(/\./, $ipaddr)), 2))[0]; + if ( "$HOSTNAME" ne "" ) { + print <Hostname:$HOSTNAME  +END + } + + if ( -e "/var/ipfire/red/remote-ipaddress" ) { + my $GATEWAY = `cat /var/ipfire/red/remote-ipaddress`; + chomp($GATEWAY); + print <Gateway:$GATEWAY  +END + } + my $DNS1 = `cat /var/ipfire/red/dns1`; my $DNS2 = `cat /var/ipfire/red/dns2`; chomp($DNS1); diff --git a/html/cgi-bin/logs.cgi/colours.txt b/html/cgi-bin/logs.cgi/colours.txt new file mode 100644 index 0000000000..93964e1d2d --- /dev/null +++ b/html/cgi-bin/logs.cgi/colours.txt @@ -0,0 +1,12 @@ +!"R" "G" "B" "Colour Name" + 57 44 187 colour1 + 79 125 255 colour2 + 79 185 255 colour3 + 79 225 255 colour4 +189 225 255 colour5 +195 183 255 colour6 +195 125 255 colour7 +195 241 197 colour8 +195 241 140 colour9 + 86 202 145 colour10 + diff --git a/html/cgi-bin/logs.cgi/firewalllogip.dat b/html/cgi-bin/logs.cgi/firewalllogip.dat index 8175d5bf06..38cce251df 100644 --- a/html/cgi-bin/logs.cgi/firewalllogip.dat +++ b/html/cgi-bin/logs.cgi/firewalllogip.dat @@ -7,7 +7,8 @@ # JC HERITIER # page inspired from the initial firewalllog.dat # -# Modified for IPFire by Christian Schmidt (www.ipfire.org) +# Modified for IPFire by Christian Schmidt +# and Michael Tremer (www.ipfire.org) use strict; use Geo::IP::PurePerl; @@ -387,16 +388,16 @@ if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) { $mygraph->set( dclrs => [ "colour1" , "colour2" , "colour3" , "colour4" , "colour5" , "colour6" , "colour7" , "colour8" , "colour9" , "colour10" ] ); my $myimage = $mygraph->plot(\@data) or die $mygraph->error; - my @filenames = glob("/srv/web/ipfire/html/fwlogs/ip*.png"); + my @filenames = glob("/srv/web/ipfire/html/graphs/fwlog-ip*.png"); unlink(@filenames); my $imagerandom = rand(1000000); - my $imagename = "/srv/web/ipfire/html/fwlogs/ip$imagerandom.png"; + my $imagename = "/srv/web/ipfire/html/graphs/fwlog-ip$imagerandom.png"; open(FILE,">$imagename"); print FILE $myimage->png; close(FILE); ##################################################### print "
"; - print ""; + print ""; print "
"; } diff --git a/html/cgi-bin/logs.cgi/firewalllogport.dat b/html/cgi-bin/logs.cgi/firewalllogport.dat index 73cfb3d5f3..657180979b 100644 --- a/html/cgi-bin/logs.cgi/firewalllogport.dat +++ b/html/cgi-bin/logs.cgi/firewalllogport.dat @@ -7,7 +7,8 @@ # JC HERITIER # page inspired from the initial firewalllog.dat # -# Modified for IPFire by Christian Schmidt (www.ipfire.org) +# Modified for IPFire by Christian Schmidt +# and Michael Tremer (www.ipfire.org) use strict; @@ -387,16 +388,16 @@ if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) { $mygraph->set( dclrs => [ "colour1" , "colour2" , "colour3" , "colour4" , "colour5" , "colour6" , "colour7" , "colour8" , "colour9" , "colour10" ] ); my $myimage = $mygraph->plot(\@data) or die $mygraph->error; - my @filenames = glob("/srv/web/ipfire/html/fwlogs/port*.png"); + my @filenames = glob("/srv/web/ipfire/html/graphs/fwlog-port*.png"); unlink(@filenames); my $imagerandom = rand(1000000); - my $imagename = "/srv/web/ipfire/html/fwlogs/port$imagerandom.png"; + my $imagename = "/srv/web/ipfire/html/graphs/fwlog-port$imagerandom.png"; open(FILE,">$imagename"); print FILE $myimage->png; close(FILE); ##################################################### print "
"; - print ""; + print ""; print "
"; } diff --git a/html/cgi-bin/uptime.cgi b/html/cgi-bin/uptime.cgi deleted file mode 100644 index ab6eaf2ecb..0000000000 --- a/html/cgi-bin/uptime.cgi +++ /dev/null @@ -1,154 +0,0 @@ -#!/usr/bin/perl -# -# IPFire CGIs -# -# This code is distributed under the terms of the GPL -# -# (c) The IPFire Team -# - -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"; - -my %uptimesettings = (); -my %proxysettings = (); -my %checked = (); -my $message = ""; -my $errormessage = ""; -my %selected= () ; -my $uptimefile = "/var/ipfire/uptime/yasuc.conf"; -&General::readhash("${General::swroot}/proxy/advanced/settings", \%proxysettings); - -&Header::showhttpheaders(); - -$uptimesettings{'ENABLE'} = 'off'; -$uptimesettings{'USER'} = ''; -$uptimesettings{'PASS'} = ''; -$uptimesettings{'PROXY'} = $proxysettings{'ENABLE'}; -### Values that have to be initialized -$uptimesettings{'ACTION'} = ''; - -&General::readhash("${General::swroot}/uptime/settings", \%uptimesettings); -&Header::getcgihash(\%uptimesettings); - -&Header::openpage('Uptime Client', 1, ''); -&Header::openbigbox('100%', 'left', '', $errormessage); - -############################################################################################################################ -############################################################################################################################ - -if ($uptimesettings{'ACTION'} eq $Lang::tr{'save'}) -{ - &save_configuration(); -} -elsif ($uptimesettings{'ACTION'} eq $Lang::tr{'uptime enable'}) -{ - &save_configuration(); - system("/usr/bin/touch ${General::swroot}/uptime/enabled"); - system("/usr/local/bin/yasucctrl enable"); -} -elsif ($uptimesettings{'ACTION'} eq $Lang::tr{'uptime disable'}) -{ - unlink "${General::swroot}/uptime/enabled"; - system("/usr/local/bin/yasucctrl disable"); -} -elsif ($uptimesettings{'ACTION'} eq $Lang::tr{'uptime update now'}) -{ - &save_configuration(); - system("/usr/local/bin/yasucctrl"); -} - -&General::readhash("${General::swroot}/uptime/settings", \%uptimesettings); - -if ($errormessage) { - &Header::openbox('100%', 'left', $Lang::tr{'error messages'}); - print "$errormessage\n"; - print " \n"; - &Header::closebox(); -} - -$checked{'PROXY'}{'on'} = ''; -$checked{'PROXY'}{'off'} = ''; -$checked{'PROXY'}{"$uptimesettings{'PROXY'}"} = 'checked'; - -############################################################################################################################ -############################################################################################################################ - -&Header::openbox('100%', 'center', 'Uptime Client'); -print < -END -; - if ( $message ne "" ) { - print "$message"; - } - - my $status = ""; - my $status_color = ""; - if ( -e "${General::swroot}/uptime/enabled" ){ - $status_color = $Header::colourgreen; - $status = $Lang::tr{'running'}; - } else { - $status_color = $Header::colourred; - $status = $Lang::tr{'stopped'}; - } - - print < - Uptime Client: - - - - - $status - -
-
- -
Basisoptionen -
Username: -
Password: - -
Proxyeinstellungen -
Use proxy: -
-
-
-END -; -&Header::closebox(); -&Header::closebigbox(); -&Header::closepage(); - -############################################################################################################################ -############################################################################################################################ - -sub save_configuration { - # A small helper to create our configurationfile - &General::writehash("${General::swroot}/uptime/settings", \%uptimesettings); - if ($uptimesettings{'PROXY'} == "on"){ $uptimesettings{'PROXY'} = "yes";} - if ($uptimesettings{'PROXY'} == "off"){ $uptimesettings{'PROXY'} = "no";} - open( FILE, "> $uptimefile" ) or die "Unable to write $uptimefile"; - print FILE < # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 0.86 + +THISAPP = GDTextUtil-$(VER) +DL_FILE = $(THISAPP).tar.gz +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_MD5 = 941ad06eadc86b47f3a32da405665c41 + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +md5 : $(subst %,%_MD5,$(objects)) + +############################################################################### +# Downloading, checking, md5sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_MD5,$(objects)) : + @$(MD5) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && perl Makefile.PL + cd $(DIR_APP) && make $(MAKETUNING) + cd $(DIR_APP) && make install + @rm -rf $(DIR_APP) + @$(POSTBUILD) diff --git a/lfs/configroot b/lfs/configroot index 6be94cf3f4..6bceb28bce 100644 --- a/lfs/configroot +++ b/lfs/configroot @@ -52,9 +52,11 @@ $(TARGET) : @$(PREBUILD) # Create all directories - for i in addon-lang alcatelusb auth backup ca certs cnx_pci connscheduler crls ddns dhcp dhcpc dmzholes \ - eagle-usb eciadsl ethernet extrahd/bin isdn key langs logging main mbmon menu.d modem net-traffic nfs optionsfw outgoing/bin patches pakfire portfw \ - ppp private proxy/advanced qos/bin red remote snort time updatexlrator/bin updatexlrator/autocheck urlfilter/autoupdate urlfilter/bin upnp vpn \ + for i in addon-lang auth backup ca certs connscheduler crls ddns dhcp dhcpc dmzholes \ + ethernet extrahd/bin fwlogs isdn key langs logging main mbmon menu.d modem net-traffic \ + nfs optionsfw outgoing/bin patches pakfire portfw \ + ppp private proxy/advanced qos/bin red remote snort time \ + updatexlrator/bin updatexlrator/autocheck urlfilter/autoupdate urlfilter/bin upnp vpn \ wakeonlan wireless xtaccess ; do \ mkdir -p $(CONFIG_ROOT)/$$i; \ done @@ -63,7 +65,7 @@ $(TARGET) : for i in auth/users backup/include.user backup/exclude.user \ certs/index.txt ddns/config ddns/noipsettings ddns/settings ddns/ipcache dhcp/settings \ dhcp/fixleases dhcp/advoptions dmzholes/config ethernet/aliases ethernet/settings \ - extrahd/scan extrahd/devices extrahd/partitions extrahd/settings \ + extrahd/scan extrahd/devices extrahd/partitions extrahd/settings fwlogs/ipsettings fwlogs/portsettings\ isdn/settings main/hosts main/settings optionsfw/settings outgoing/settings outgoing/rules pakfire/settings \ portfw/config ppp/settings-1 ppp/settings-2 ppp/settings-3 ppp/settings-4 \ ppp/settings-5 ppp/settings proxy/settings proxy/advanced/settings remote/settings qos/settings qos/classes qos/subclasses qos/level7config qos/portconfig \ diff --git a/make.sh b/make.sh index 97365a496c..1caee37f29 100644 --- a/make.sh +++ b/make.sh @@ -395,6 +395,7 @@ buildipfire() { ipfiremake fcron ipfiremake GD ipfiremake GD-Graph + ipfiremake GD-TextUtil ipfiremake gnupg ipfiremake hdparm ipfiremake ibod diff --git a/tools/check_strings.pl b/tools/check_strings.pl index 36189872aa..4d5650ca85 100644 --- a/tools/check_strings.pl +++ b/tools/check_strings.pl @@ -49,6 +49,7 @@ sub wanted { ## Main find (\&wanted, "$basedir/html" ); find (\&wanted, "$basedir/src/scripts" ); +find (\&wanted, "$basedir/config/cfgroot" ); for my $key ( sort (keys %tr) ) { my $value = $tr{$key}; -- 2.39.2