| Server IP : 104.21.37.246 / Your IP : 104.23.243.33 [ Web Server : Apache System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64 User : cp648411 ( 1354) PHP Version : 7.2.34 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/2388322/task/2388322/cwd/3rdparty/cloudlinux/ |
Upload File : |
#!/bin/sh
eval 'if [ -x /usr/local/cpanel/3rdparty/bin/perl ]; then exec /usr/local/cpanel/3rdparty/bin/perl -x -- $0 ${1+"$@"}; else exec /usr/bin/perl -x -- $0 ${1+"$@"};fi'
if 0;
#!/usr/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
# CloudLinux LVE Manager VERSION:0.60
BEGIN { unshift @INC, "/usr/local/cpanel"; }
use strict;
use Cpanel::Form ();
use Cpanel::PwCache ();
use Cpanel::SafeRun ();
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";
my $user = $ENV{'REMOTE_USER'};
my $lveid = ( Cpanel::PwCache::getpwnam($user) )[2];
my $period = $FORM{'period'};
if ( defined $period and $period =~ /(today|yesterday|\d+[mhd])/ ) {
$period = $1;
}
else {
$period = '1d';
}
my @params = (
'/usr/sbin/lvechart', "--period=$period", '--style=user', "--id=$lveid",
'--width=9', '--height=9', '--dpi=70'
);
if ( lvestats_ver() == 2 ) {
push @params, '--format=svg';
}
my $out = Cpanel::SafeRun::Errors::saferunallerrors(@params);
my $image_mime = detect_image_mime($out);
print "Content-type: $image_mime\r\n\r\n";
print $out;
sub detect_image_mime {
# for more info see Image::Info source
local($_) = @_;
return "image/png" if /^\x89PNG\x0d\x0a\x1a\x0a/;
return "image/svg+xml" if /^(<\?xml|[\012\015\t ]*<svg\b)/;
return "image/jpeg" if /^\xFF\xD8/;
return "image/gif" if /^GIF8[79]a/;
return undef;
}
# return integer lvestats version
sub lvestats_ver {
if (-e '/usr/sbin/lve-read-snapshot') {
return 2
};
return 1
}