X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=html%2Fcgi-bin%2Fmedia.cgi;h=490ffcad94d98406dbfeb3a048d0a8cb72dc1b4d;hb=0c5393e3d1110f0e64eb6739c417978cf1356736;hp=2cb1d4a377e05f2be8033bca7fc46ff78d02a298;hpb=51585c70de84487e9a2365547203e2e7f5160de8;p=people%2Fpmueller%2Fipfire-2.x.git
diff --git a/html/cgi-bin/media.cgi b/html/cgi-bin/media.cgi
index 2cb1d4a377..490ffcad94 100644
--- a/html/cgi-bin/media.cgi
+++ b/html/cgi-bin/media.cgi
@@ -1,12 +1,23 @@
#!/usr/bin/perl
-#
-# SmoothWall CGIs
-#
-# This code is distributed under the terms of the GPL
-#
-# (c) The SmoothWall Team
-#
-#
+###############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2008 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;
@@ -19,37 +30,50 @@ require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
require "${General::swroot}/graphs.pl";
+my %color = ();
+my %mainsettings = ();
+&General::readhash("${General::swroot}/main/settings", \%mainsettings);
+&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
+
#workaround to suppress a warning when a variable is used only once
my @dummy = ( ${Header::colourred} );
undef (@dummy);
my %cgiparams=();
-&Header::showhttpheaders();
-
-&Header::getcgihash(\%cgiparams);
-
-&Header::openpage($Lang::tr{'media information'}, 1, '');
-
-&Header::openbigbox('100%', 'left');
+my @querry = split(/\?/,$ENV{'QUERY_STRING'});
+$querry[0] = '' unless defined $querry[0];
+$querry[1] = 'hour' unless defined $querry[1];
my @devices = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`;
-foreach (@devices) {
- my $device = $_;
- chomp($device);
- &Graphs::updatediskgraph ("day",$device);
- diskbox("$device");
-}
-
-&Header::openbox('100%', 'center', $Lang::tr{'disk usage'});
-print "
\n";
-open(DF,'/bin/df -B M -x rootfs|');
-while()
-{
- if ($_ =~ m/^Filesystem/ )
- {
- print <\n";
+ open(DF,'/bin/df -B M -x rootfs|');
+ while(){
+ if ($_ =~ m/^Filesystem/ ){
+ print <