kleiner Zwischenfix
authormaniacikarus <maniacikarus@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Mon, 26 Mar 2007 19:16:19 +0000 (19:16 +0000)
committermaniacikarus <maniacikarus@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Mon, 26 Mar 2007 19:16:19 +0000 (19:16 +0000)
git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@464 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8

config/rootfiles/common/apache2
html/cgi-bin/logs.cgi/colours.txt [deleted file]
html/cgi-bin/logs.cgi/firewalllogip.dat
html/cgi-bin/logs.cgi/firewalllogport.dat
html/html/themes/ipfire/include/colours.txt [new file with mode: 0644]

index 70c4902..c417eeb 100644 (file)
@@ -1285,7 +1285,6 @@ 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
@@ -1664,6 +1663,7 @@ srv/web/ipfire/html
 #srv/web/ipfire/html/themes/ipfire/images/n6.gif
 #srv/web/ipfire/html/themes/ipfire/images/spacer.gif
 #srv/web/ipfire/html/themes/ipfire/include
+#srv/web/ipfire/html/themes/ipfire/include/colours.txt
 #srv/web/ipfire/html/themes/ipfire/include/functions.pl
 #srv/web/ipfire/html/themes/ipfire/include/style.css
 #srv/web/ipfire/html/updatecache
diff --git a/html/cgi-bin/logs.cgi/colours.txt b/html/cgi-bin/logs.cgi/colours.txt
deleted file mode 100644 (file)
index 93964e1..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-!"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
index 99697ba..e121657 100644 (file)
@@ -7,7 +7,8 @@
 # JC HERITIER 
 # page inspired from the initial firewalllog.dat
 #
-# modified for ipcop by Markus Hoffmann und Michael Winkler and for ipfire by Christian Schmidt
+# Modified for IPFire by Christian Schmidt
+#                            and Michael Tremer (www.ipfire.org)
 
 use strict;
 use Geo::IP::PurePerl;
@@ -41,11 +42,11 @@ $cgiparams{'showpie'} = 1;
 $cgiparams{'sortcolumn'} = 1;
 
 my @shortmonths = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug',
-       'Sep', 'Oct', 'Nov', 'Dec' );
+        'Sep', 'Oct', 'Nov', 'Dec' );
 my @longmonths = ( $Lang::tr{'january'}, $Lang::tr{'february'}, $Lang::tr{'march'},
-       $Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
-       $Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
-       $Lang::tr{'december'} );
+        $Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
+        $Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
+        $Lang::tr{'december'} );
 
 my @now = localtime();
 my $dow = $now[6];
@@ -77,17 +78,17 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save'})
 my $start = -1;
 if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'})
 {
-       my @temp = split(',',$ENV{'QUERY_STRING'});
-       $start = $temp[0];
-       $cgiparams{'MONTH'} = $temp[1];
-       $cgiparams{'DAY'} = $temp[2];
+        my @temp = split(',',$ENV{'QUERY_STRING'});
+        $start = $temp[0];
+        $cgiparams{'MONTH'} = $temp[1];
+        $cgiparams{'DAY'} = $temp[2];
 }
 
 if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
     !($cgiparams{'DAY'} =~ /^(1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$/))
 {
-       $cgiparams{'DAY'} = $now[3];
-       $cgiparams{'MONTH'} = $now[4];
+        $cgiparams{'DAY'} = $now[3];
+        $cgiparams{'MONTH'} = $now[4];
 }
 elsif($cgiparams{'ACTION'} eq '>>')
 {
@@ -153,9 +154,9 @@ my $longmonthstr = $longmonths[$cgiparams{'MONTH'}];
 my $day = $cgiparams{'DAY'};
 my $daystr='';
 if ($day <= 9) {
-       $daystr = " $day"; }
+        $daystr = " $day"; }
 else {
-       $daystr = $day;
+        $daystr = $day;
 }
 
 my $skip=0;
@@ -179,12 +180,12 @@ if (!$skip)
 {
         while (<FILE>)
         {
-               if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
-                       $log[$lines] = $_;
-                       $lines++;
-               }
-       }
-       close (FILE);   
+                if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
+                        $log[$lines] = $_;
+                        $lines++;
+                }
+        }
+        close (FILE);   
 }
 
 $skip=0;
@@ -201,14 +202,14 @@ if ($multifile) {
                 $skip=1;
         }
         if (!$skip) {
-               while (<FILE>) {
-                       if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
-                               $log[$lines] = $_;
-                               $lines++;
-                       }
-               }
-               close (FILE);
-       }
+                while (<FILE>) {
+                        if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
+                                $log[$lines] = $_;
+                                $lines++;
+                        }
+                }
+                close (FILE);
+        }
 }
 
 my $MODNAME="fwlogs";
@@ -219,9 +220,9 @@ my $MODNAME="fwlogs";
 
 
 if ($errormessage) {
-       &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
-       print "<font class='base'>$errormessage&nbsp;</font>\n";
-       &Header::closebox();
+        &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
+        print "<font class='base'>$errormessage&nbsp;</font>\n";
+        &Header::closebox();
 }
 
 &Header::openbox('100%', 'left', "$Lang::tr{'settings'}:");
@@ -230,33 +231,33 @@ print <<END
 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
 <table width='100%'>
 <tr>
-       <td width='10%' class='base'>$Lang::tr{'month'}:&nbsp;</td>
-       <td width='10%'>
-       <select name='MONTH'>
+        <td width='10%' class='base'>$Lang::tr{'month'}:&nbsp;</td>
+        <td width='10%'>
+        <select name='MONTH'>
 END
 ;
 my $month;
 for ($month = 0; $month < 12; $month++)
 {
-       print "\t<option ";
-       if ($month == $cgiparams{'MONTH'}) {
-               print "selected='selected' "; }
-       print "value='$month'>$longmonths[$month]</option>\n";
+        print "\t<option ";
+        if ($month == $cgiparams{'MONTH'}) {
+                print "selected='selected' "; }
+        print "value='$month'>$longmonths[$month]</option>\n";
 }
 print <<END
-       </select>
-       </td>
-       <td width='10%' class='base' align='right'>&nbsp;$Lang::tr{'day'}:&nbsp;</td>
-       <td width='40%'>
-       <select name='DAY'>
+        </select>
+        </td>
+        <td width='10%' class='base' align='right'>&nbsp;$Lang::tr{'day'}:&nbsp;</td>
+        <td width='40%'>
+        <select name='DAY'>
 END
 ;
 for ($day = 1; $day <= 31; $day++) 
 {
-       print "\t<option ";
-       if ($day == $cgiparams{'DAY'}) {
-               print "selected='selected' "; }
-       print "value='$day'>$day</option>\n";
+        print "\t<option ";
+        if ($day == $cgiparams{'DAY'}) {
+                print "selected='selected' "; }
+        print "value='$day'>$day</option>\n";
 }
 
 if( $cgiparams{'pienumber'} != 0){$pienumber=$cgiparams{'pienumber'};}
@@ -274,8 +275,8 @@ print <<END
 </table>
 <table width='100%'>
 <tr><td width='20%' align='right' valign="center">$Lang::tr{'Number of IPs for the pie chart'}:</td>
-         <td width='10%' align='left' valign="center"><input type='text' name='pienumber' value='$pienumber' size='4'></td>
-         <td width='20%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td></tr>
+          <td width='10%' align='left' valign="center"><input type='text' name='pienumber' value='$pienumber' size='4'></td>
+          <td width='20%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td></tr>
        </table>
        </form>
 END
@@ -319,11 +320,11 @@ my @tabjc2;
 
 if ($sortcolumn == 1)
 {
-       @tabjc2 = sort { $b <=> $a } values (%tabjc);
+        @tabjc2 = sort { $b <=> $a } values (%tabjc);
 }
 else
 {
-       @tabjc2 = sort { $a <=> $b } keys (%tabjc);
+        @tabjc2 = sort { $a <=> $b } keys (%tabjc);
 }
 
 my $colour=1;
@@ -337,17 +338,17 @@ my $v;
 
 if ($sortcolumn == 1)
 {
-       for ($v=0;$v<$pienumber;$v++){
-         findkey($tabjc2[$v]);
-       }
+        for ($v=0;$v<$pienumber;$v++){
+          findkey($tabjc2[$v]);
+        }
 }
 else
 {
-       foreach $v (@tabjc2) {
-         $key[$indice] = $v;
-         $value[$indice] = $tabjc{$v};
-         $indice++;
-       }
+        foreach $v (@tabjc2) {
+          $key[$indice] = $v;
+          $value[$indice] = $tabjc{$v};
+          $indice++;
+        }
 }
 
 my @ips;
@@ -360,44 +361,44 @@ my $o;
 
 if($cgiparams{'otherspie'} == 2 ){}
 else{ 
-       my $numothers;
-       for($o=0;$o<$pienumber;$o++){
-         $numothers = $numothers + $numb[$o];
-       }
-       $numothers =  $linesjc - $numothers;
-       if ($numothers > 0) {
-               $ips[$pienumber]="$Lang::tr{'otherip'}";
-               $numb[$pienumber] =  $numothers;
-       }
+        my $numothers;
+        for($o=0;$o<$pienumber;$o++){
+          $numothers = $numothers + $numb[$o];
+        }
+        $numothers =  $linesjc - $numothers;
+        if ($numothers > 0) {
+                $ips[$pienumber]="$Lang::tr{'otherip'}";
+                $numb[$pienumber] =  $numothers;
+        }
 }
 
 my @data = (\@ips,\@numb);
 use GD::Graph::colour qw( :files );
-GD::Graph::colour::read_rgb( "/srv/web/ipfire/cgi-bin/logs.cgi/colours.txt" );
+GD::Graph::colour::read_rgb( "/srv/web/ipfire/html/themes/ipfie/include/colours.txt" );
 
 if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) {
-       my $mygraph = GD::Graph::pie->new(500, 350);
-       $mygraph->set(
-             'title' => '',
-             'pie_height' => 50,
-             'start_angle' => 89
-            ) or warn $mygraph->error;
-
-       $mygraph->set_value_font(GD::gdMediumBoldFont);
-       $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");
-       unlink(@filenames);
-       my $imagerandom = rand(1000000);
-       my $imagename = "/srv/web/ipfire/html/fwlogs/ip$imagerandom.png";
-       open(FILE,">$imagename");
-       print FILE $myimage->png;
-       close(FILE);
-       #####################################################
-       print "<table align='center'><tr><td>";
-       print "<img src='/fwlogs/ip$imagerandom.png'>";
-       print "</td></tr></table>";
+        my $mygraph = GD::Graph::pie->new(500, 350);
+        $mygraph->set(
+              'title' => '',
+              'pie_height' => 50,
+              'start_angle' => 89
+             ) or warn $mygraph->error;
+
+        $mygraph->set_value_font(GD::gdMediumBoldFont);
+        $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/graphs/fwlog-ip*.png");
+        unlink(@filenames);
+        my $imagerandom = rand(1000000);
+        my $imagename = "/srv/web/ipfire/html/graphs/fwlog-ip$imagerandom.png";
+        open(FILE,">$imagename");
+        print FILE $myimage->png;
+        close(FILE);
+        #####################################################
+        print "<table align='center'><tr><td>";
+        print "<img src='/graphs/fwlog-ip$imagerandom.png'>";
+        print "</td></tr></table>";
 }
 
 print <<END
@@ -529,6 +530,6 @@ sub findkey {
     }
   }
 }sub checkversion {
-       #Automatic Updates is disabled
-       return "0","0";
-       }
+        #Automatic Updates is disabled
+        return "0","0";
+        }
index 5cf00fb..a96e47d 100644 (file)
@@ -7,7 +7,8 @@
 # JC HERITIER 
 # page inspired from the initial firewalllog.dat
 #
-# modified for ipcop by Markus Hoffmann und Michael Winkler and for ipfire by Christian Schmidt
+# Modified for IPFire by Christian Schmidt
+#                            and Michael Tremer (www.ipfire.org)
 
 use strict;
 
@@ -39,11 +40,11 @@ $cgiparams{'showpie'} = 1;
 $cgiparams{'sortcolumn'} = 1;
 
 my @shortmonths = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug',
-       'Sep', 'Oct', 'Nov', 'Dec' );
+        'Sep', 'Oct', 'Nov', 'Dec' );
 my @longmonths = ( $Lang::tr{'january'}, $Lang::tr{'february'}, $Lang::tr{'march'},
-       $Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
-       $Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
-       $Lang::tr{'december'} );
+        $Lang::tr{'april'}, $Lang::tr{'may'}, $Lang::tr{'june'}, $Lang::tr{'july'}, $Lang::tr{'august'},
+        $Lang::tr{'september'}, $Lang::tr{'october'}, $Lang::tr{'november'},
+        $Lang::tr{'december'} );
 
 my @now = localtime();
 my $dow = $now[6];
@@ -75,17 +76,17 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save'})
 my $start = -1;
 if ($ENV{'QUERY_STRING'} && $cgiparams{'ACTION'} ne $Lang::tr{'update'})
 {
-       my @temp = split(',',$ENV{'QUERY_STRING'});
-       $start = $temp[0];
-       $cgiparams{'MONTH'} = $temp[1];
-       $cgiparams{'DAY'} = $temp[2];
+        my @temp = split(',',$ENV{'QUERY_STRING'});
+        $start = $temp[0];
+        $cgiparams{'MONTH'} = $temp[1];
+        $cgiparams{'DAY'} = $temp[2];
 }
 
 if (!($cgiparams{'MONTH'} =~ /^(0|1|2|3|4|5|6|7|8|9|10|11)$/) ||
     !($cgiparams{'DAY'} =~ /^(1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$/))
 {
-       $cgiparams{'DAY'} = $now[3];
-       $cgiparams{'MONTH'} = $now[4];
+        $cgiparams{'DAY'} = $now[3];
+        $cgiparams{'MONTH'} = $now[4];
 }
 elsif($cgiparams{'ACTION'} eq '>>')
 {
@@ -151,9 +152,9 @@ my $longmonthstr = $longmonths[$cgiparams{'MONTH'}];
 my $day = $cgiparams{'DAY'};
 my $daystr='';
 if ($day <= 9) {
-       $daystr = " $day"; }
+        $daystr = " $day"; }
 else {
-       $daystr = $day;
+        $daystr = $day;
 }
 
 my $skip=0;
@@ -177,12 +178,12 @@ if (!$skip)
 {
         while (<FILE>)
         {
-               if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
-                       $log[$lines] = $_;
-                       $lines++;
-               }
-       }
-       close (FILE);   
+                if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
+                        $log[$lines] = $_;
+                        $lines++;
+                }
+        }
+        close (FILE);   
 }
 
 $skip=0;
@@ -199,14 +200,14 @@ if ($multifile) {
                 $skip=1;
         }
         if (!$skip) {
-               while (<FILE>) {
-                       if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
-                               $log[$lines] = $_;
-                               $lines++;
-                       }
-               }
-               close (FILE);
-       }
+                while (<FILE>) {
+                        if (/(^${monthstr} ${daystr} ..:..:..) [\w\-]+ kernel:.*(IN=.*)$/) {
+                                $log[$lines] = $_;
+                                $lines++;
+                        }
+                }
+                close (FILE);
+        }
 }
 
 my $MODNAME="fwlogs";
@@ -216,9 +217,9 @@ my $MODNAME="fwlogs";
 &Header::openbigbox('100%', 'left', '', $errormessage);
 
 if ($errormessage) {
-       &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
-       print "<font class='base'>$errormessage&nbsp;</font>\n";
-       &Header::closebox();
+        &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
+        print "<font class='base'>$errormessage&nbsp;</font>\n";
+        &Header::closebox();
 }
 
 &Header::openbox('100%', 'left', "$Lang::tr{'settings'}:");
@@ -227,33 +228,33 @@ print <<END
 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
 <table width='100%'>
 <tr>
-       <td width='10%' class='base'>$Lang::tr{'month'}:&nbsp;</td>
-       <td width='10%'>
-       <select name='MONTH'>
+        <td width='10%' class='base'>$Lang::tr{'month'}:&nbsp;</td>
+        <td width='10%'>
+        <select name='MONTH'>
 END
 ;
 my $month;
 for ($month = 0; $month < 12; $month++)
 {
-       print "\t<option ";
-       if ($month == $cgiparams{'MONTH'}) {
-               print "selected='selected' "; }
-       print "value='$month'>$longmonths[$month]</option>\n";
+        print "\t<option ";
+        if ($month == $cgiparams{'MONTH'}) {
+                print "selected='selected' "; }
+        print "value='$month'>$longmonths[$month]</option>\n";
 }
 print <<END
-       </select>
-       </td>
-       <td width='10%' class='base' align='right'>&nbsp;$Lang::tr{'day'}:&nbsp;</td>
-       <td width='40%'>
-       <select name='DAY'>
+        </select>
+        </td>
+        <td width='10%' class='base' align='right'>&nbsp;$Lang::tr{'day'}:&nbsp;</td>
+        <td width='40%'>
+        <select name='DAY'>
 END
 ;
 for ($day = 1; $day <= 31; $day++) 
 {
-       print "\t<option ";
-       if ($day == $cgiparams{'DAY'}) {
-               print "selected='selected' "; }
-       print "value='$day'>$day</option>\n";
+        print "\t<option ";
+        if ($day == $cgiparams{'DAY'}) {
+                print "selected='selected' "; }
+        print "value='$day'>$day</option>\n";
 }
 
 if( $cgiparams{'pienumber'} != 0){$pienumber=$cgiparams{'pienumber'};}
@@ -316,11 +317,11 @@ my @tabjc2;
 
 if ($sortcolumn == 1)
 {
-       @tabjc2 = sort { $b <=> $a } values (%tabjc);
+        @tabjc2 = sort { $b <=> $a } values (%tabjc);
 }
 else
 {
-       @tabjc2 = sort { $a <=> $b } keys (%tabjc);
+        @tabjc2 = sort { $a <=> $b } keys (%tabjc);
 }
 
 my $colour=1;
@@ -337,17 +338,17 @@ my $v;
 
 if ($sortcolumn == 1)
 {
-       for ($v=0;$v<$pienumber;$v++){
-         findkey($tabjc2[$v]);
-       }
+        for ($v=0;$v<$pienumber;$v++){
+          findkey($tabjc2[$v]);
+        }
 }
 else
 {
-       foreach $v (@tabjc2) {
-         $key[$indice] = $v;
-         $value[$indice] = $tabjc{$v};
-         $indice++;
-       }
+        foreach $v (@tabjc2) {
+          $key[$indice] = $v;
+          $value[$indice] = $tabjc{$v};
+          $indice++;
+        }
 }
 
 my @ports;
@@ -360,44 +361,44 @@ my $o;
 
 if($cgiparams{'otherspie'} == 2 ){}
 else{ 
-       my $numothers;
-       for($o=0;$o<$pienumber;$o++){
-         $numothers = $numothers + $numb[$o];
-       }
-       $numothers =  $linesjc - $numothers;
-       if ($numothers > 0) {
-               $ports[$pienumber]="$Lang::tr{'otherport'}";
-               $numb[$pienumber] =  $numothers;
-       }
+        my $numothers;
+        for($o=0;$o<$pienumber;$o++){
+          $numothers = $numothers + $numb[$o];
+        }
+        $numothers =  $linesjc - $numothers;
+        if ($numothers > 0) {
+                $ports[$pienumber]="$Lang::tr{'otherport'}";
+                $numb[$pienumber] =  $numothers;
+        }
 }
 
 my @data = (\@ports,\@numb);
 use GD::Graph::colour qw( :files );
-GD::Graph::colour::read_rgb( "/srv/web/ipfire/cgi-bin/logs.cgi/colours.txt" );
+GD::Graph::colour::read_rgb( "/srv/web/ipfire/html/themes/ipfie/include/colours.txt" );
 
 if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) {
-       my $mygraph = GD::Graph::pie->new(500, 350);
-       $mygraph->set(
-             'title' => '',
-             'pie_height' => 50,
-             'start_angle' => 89
-            ) or warn $mygraph->error;
-
-       $mygraph->set_value_font(GD::gdMediumBoldFont);
-       $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");
-       unlink(@filenames);
-       my $imagerandom = rand(1000000);
-       my $imagename = "/srv/web/ipfire/html/fwlogs/port$imagerandom.png";
-       open(FILE,">$imagename");
-       print FILE $myimage->png;
-       close(FILE);
-       #####################################################
-       print "<table align='center'><tr><td>";
-       print "<img src='/fwlogs/port$imagerandom.png'>";
-       print "</td></tr></table>";
+        my $mygraph = GD::Graph::pie->new(500, 350);
+        $mygraph->set(
+              'title' => '',
+              'pie_height' => 50,
+              'start_angle' => 89
+             ) or warn $mygraph->error;
+
+        $mygraph->set_value_font(GD::gdMediumBoldFont);
+        $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/graphs/fwlog-port*.png");
+        unlink(@filenames);
+        my $imagerandom = rand(1000000);
+        my $imagename = "/srv/web/ipfire/html/graphs/fwlog-port$imagerandom.png";
+        open(FILE,">$imagename");
+        print FILE $myimage->png;
+        close(FILE);
+        #####################################################
+        print "<table align='center'><tr><td>";
+        print "<img src='/graphs/fwlog-port$imagerandom.png'>";
+        print "</td></tr></table>";
 }
 
 print <<END
@@ -520,6 +521,7 @@ sub findkey {
   }
 }
 sub checkversion {
-       #Automatic Updates is disabled
-       return "0","0";
-       }
+        #Automatic Updates is disabled
+        return "0","0";
+        }
+
diff --git a/html/html/themes/ipfire/include/colours.txt b/html/html/themes/ipfire/include/colours.txt
new file mode 100644 (file)
index 0000000..e65b5ab
--- /dev/null
@@ -0,0 +1,11 @@
+!"R" "G" "B"           "Colour Name"\r
+ 205  91 69            colour1\r
+ 238 106 80            colour2\r
+ 255 114 86            colour3\r
+ 238 149 114           colour4\r
+ 255 160 122           colour5\r
+ 255 160 122           colour6\r
+ 205 175 149           colour7\r
+ 238 203 173           colour8\r
+ 255 218 185           colour9\r
+ 255 228 196           colour10
\ No newline at end of file