Mini Shell

Direktori : /usr/share/lvemanager-xray/plugins/cpanel/
Upload File :
Current File : //usr/share/lvemanager-xray/plugins/cpanel/xray.live.pl

#!/usr/local/cpanel/3rdparty/bin/perl

# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT

BEGIN {
    unshift @INC, '/usr/local/cpanel', '/usr/local/cpanel/whostmgr/docroot/3rdparty/cloudlinux',
        '/usr/share/l.v.e-manager/cpanel/cgi';
    #use CGI::Carp qw(fatalsToBrowser); # for detail comments
}

use strict;
use warnings;
use locale ':not_characters';   # utf-8

use Cpanel::LiveAPI();
use Cpanel::JSON;
use Cpanel::Form;
use CloudLinux;
use CGI;

#use CGI::Carp qw(fatalsToBrowser); # uncomment to debug 500 error

use constant ASSETS_PATH => "/3rdparty/cloudlinux/assets/xray-user";

my $panel = Cpanel::LiveAPI->new();

my $cgi = CGI->new;

my %GET_REQUESTS    = CloudLinux::parseForm(Cpanel::Form::parseform());
my %REQUEST    = CloudLinux::parseForm($cgi->Vars);
my $cgiaction = $GET_REQUESTS{'cgiaction'} || 'default';

CloudLinux::setOwner(CloudLinux::OWNER_USER);
CloudLinux::detectLocale($cgi);

my %dispatchTable = (
    default => \&main,
    sendRequest => \&CloudLinux::lvemanagerHandler,
    knockKnock => \&CloudLinux::knockKnock,
);es

$cgiaction = 'default' unless exists $dispatchTable{$cgiaction};
$dispatchTable{$cgiaction}->(\%REQUEST, 'xray');

$panel->end();


sub main {
    CloudLinux::checkMethod('GET');
    print "Content-type: text/html; charset=utf-8\n\n";
    print $panel->header('');
    CloudLinux::getDataContent('templates', 'index.html', 1);

     printf(
        '<script type="text/javascript">' .
            'mainAction = "xray.live.pl?cgiaction=sendRequest";'.
            'pingAction = "xray.live.pl?cgiaction=knockKnock";'.
            'imagePath = "/images/spa/";'.
            'panelName = "Cpanel";'.
            'logoutUrl = "/logout";'.
        '</script>'
    );

    CloudLinux::loadGlobalVariables('../../..'.ASSETS_PATH);

    # For integration tests, don't remove comment in production in line below
    #Whostmgr::HTMLInterface::load_js(sprintf('%s/interceptor.js', ASSETS_PATH)); #for integration tests

    Whostmgr::HTMLInterface::load_css(ASSETS_PATH.'/css/xray-common.css');

    Whostmgr::HTMLInterface::load_js(sprintf('%s/xray.bundle.min.js', ASSETS_PATH));

    print $panel->footer();
}

Zerion Mini Shell 1.0