Mini Shell

Direktori : /usr/share/l.v.e-manager/ispmanager/liblve0.8/addon/
Upload File :
Current File : //usr/share/l.v.e-manager/ispmanager/liblve0.8/addon/LVEPackage.php

#!/usr/bin/php -n
<?php

/**
 * 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
 */

set_time_limit(0);
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
ini_set('display_errors', 0);

//$file = fopen('/usr/local/ispmgr/addon/test.log',"a+");

// Include Commands Class
include_once('lvemanager/preset.class.php');
@include_once('lvemanager/mini_kron.php');
$file2 = fopen('/usr/local/ispmgr/addon/lvemanager/mini_kron.php',"w+");
fclose($file2);

if ($_SERVER['REQUEST_METHOD'] == 'POST') {

    $stdin=str_replace('<></>','',file_get_contents('php://stdin'));
    
//    $file = fopen('/usr/local/ispmgr/addon/test.log',"a+");
//    foreach ($_SERVER as $key => $item) {
//        fwrite($file,PHP_EOL.$key.' - '.$item.PHP_EOL);
//    }
//    fwrite($file,PHP_EOL.PHP_EOL.$stdin);
    
//    echo $stdin;
//    exit();
    
    $commands = new LVEPreset($stdin);
    $commands->EditLVEPackage();
    $commands->PrintXml();

} else { //GET
    
      $stdin=str_replace('<></>','',file_get_contents('php://stdin'));
    
      $RequestString = urldecode($_SERVER['QUERY_STRING']);
    
//    Tmp Logger
//    $file = fopen('/usr/local/ispmgr/addon/test.log',"w+");
//    fwrite($file,$RequestString);
//    fwrite($file,PHP_EOL.PHP_EOL.$stdin);


    if ('' == $_ENV['REMOTE_USER'])
        $_ENV['REMOTE_USER'] = $_SERVER['REMOTE_USER'];
        
    // Output for users page
    if (strstr($RequestString, 'func=preset.edit') && strstr($RequestString, 'plid')) {
        $commands = new LVEPreset($stdin);
        $commands->GetMEMSelect('new');
        $commands->PrintXml();
    } elseif (strstr($RequestString, 'func=preset.edit') && strstr($RequestString, 'elid')) {
        $temp = explode('&',$RequestString);
        foreach ($temp as $item) {
            if (strstr($item,'elid')) {
                $package = str_replace('elid=','',str_replace('&','',$item));
            }
        }

        $commands = new LVEPreset($stdin);
        $commands->GetMEMSelect();
        $commands->PrintXml();
    } else {
        $commands = new LVEPreset($stdin);
        $commands->PrintXml();
    }
}

//fclose($file);

Zerion Mini Shell 1.0