]> git.ipfire.org Git - ipfire-2.x.git/blame - src/wio/wiographs.cgi
core115: Include captive portal in updater
[ipfire-2.x.git] / src / wio / wiographs.cgi
CommitLineData
0d6cc79d
SF
1#!/usr/bin/perl
2#
3###############################################################################
4# #
5# IPFire.org - A linux based firewall #
6# Copyright (C) 2017 Stephan Feddersen <addons@h-loit.de> #
7# All Rights Reserved. #
8# #
9# This program is free software: you can redistribute it and/or modify #
10# it under the terms of the GNU General Public License as published by #
11# the Free Software Foundation, either version 3 of the License, or #
12# (at your option) any later version. #
13# #
14# This program is distributed in the hope that it will be useful, #
15# but WITHOUT ANY WARRANTY; without even the implied warranty of #
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
17# GNU General Public License for more details. #
18# #
19# You should have received a copy of the GNU General Public License #
20# along with this program. If not, see <http://www.gnu.org/licenses/>. #
21# #
22###############################################################################
23#
fe6f676b 24# id: wiographs.cgi, v1.3.2 2017/08/27 14:11:16 sfeddersen
0d6cc79d
SF
25#
26# This wiographs.cgi is based on the Code from the IPCop WIO Addon
27# and is extremly adapted to work with IPFire.
28#
29# Autor: Stephan Feddersen
30# Co-Autor: Alexander Marx
31#
32
33use strict;
34
35# enable only the following on debugging purpose
36#use warnings;
37#no warnings 'once';
38#use CGI::Carp 'fatalsToBrowser';
39
40use CGI;
41my $cgi = new CGI;
42my $hostid = $cgi->param("HOSTID");
43my $hostname = $cgi->param("HOSTNAME");
44
45require '/var/ipfire/general-functions.pl';
46require '/var/ipfire/header.pl';
47require '/var/ipfire/lang.pl';
48require '/usr/lib/wio/wio-graphs.pl';
49
50my @querry = split(/\?/,$ENV{'QUERY_STRING'});
51
52$querry[0] = '' unless defined $querry[0]; # hostid
53$querry[1] = '' unless defined $querry[1]; # period
54$querry[2] = '' unless defined $querry[2]; # hostname
55
56if ($querry[0] =~ "$hostid") {
57 print "Content-type: image/png\n\n";
58 binmode(STDOUT);
59 &WIOGraphs::wio($querry[0], $querry[2], $querry[1]);
60}
61else {
62 &Header::showhttpheaders();
63 &Header::openpage("$Lang::tr{'wio'}", 1, '');
64 &Header::openbigbox('100%', 'left');
65 &Header::openbox('100%', 'left', "$Lang::tr{'wio_graphs_stat'} $hostname");
66 &WIOGraphs::wiographbox("wiographs.cgi","$hostid","day","$hostname");
dec52693 67 print"<table width='100%'><tr><td align='center'><a href='/cgi-bin/wio.cgi'><img src='/images/wio/back.png' alt='$Lang::tr{'wio_back'}' title='$Lang::tr{'wio_back'}' /></a></td></tr></table>";
0d6cc79d
SF
68 &Header::closebox();
69 &Header::closebigbox();
70 &Header::closepage();
71}
72
731;