Mini Shell
#!/usr/local/cpanel/3rdparty/bin/perl
# CloudLinux - base/3rdparty/lvechart.cgi Copyright(c) 2010 CloudLinux, Inc.
# All rights Reserved.
# http://www.cloudlinux.com
#
# 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 <http://www.gnu.org/licenses/>.
#
#CPANEL PLUGIN:lve-cpanel-enduser
use strict;
use Cpanel::Form ();
use Cpanel::PwCache ();
use Cpanel::SafeRun::Errors ();
use HTTP::Date ();
my %FORM = Cpanel::Form::parseform();
my $maxage = 300;
print "Cache-Control: max-age=$maxage, public\r\n";
print "Expires: " . HTTP::Date::time2str( time() + $maxage ) . "\r\n";
print "Content-type: image/png\r\n\r\n";
my $user = $ENV{'REMOTE_USER'};
my $lveid = ( Cpanel::PwCache::getpwnam($user) )[2];
my $period = $FORM{'period'};
if ( $period eq "" ) { $period = '1d'; }
my @params = (
'/usr/sbin/lvechart', "--period=$period", '--style=user', "--id=$lveid",
'--width=9', '--height=9', '--dpi=70'
);
my $out = Cpanel::SafeRun::Errors::saferunallerrors(@params);
print $out;
Zerion Mini Shell 1.0