Exemplo n.º 1
0
 * Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
 */
if (!defined('AJAXINCLUDED')) {
    die('Do not access directly!');
}
if (!isset($resellerLockupID)) {
    $resellerLockupID = $reseller_id;
}
$array = array('lastLog' => 0, 'log' => '');
$query = $sql->prepare("SELECT r.`ip` AS `ftp_ip`,r.`ftpport`,u.`cname`,g.`id`,g.`newlayout`,g.`rootID`,g.`serverip`,g.`port`,g.`protected`,AES_DECRYPT(g.`ftppassword`,?) AS `dftppass`,AES_DECRYPT(g.`ppassword`,?) AS `decryptedftppass`,s.`servertemplate`,t.`binarydir`,t.`shorten` FROM `gsswitch` AS g INNER JOIN `userdata` AS u ON u.`id`=g.`userid` INNER JOIN `rserverdata` AS r ON r.`id`=g.`rootID` INNER JOIN `serverlist` AS s ON g.`serverid`=s.`id` INNER JOIN `servertypes` AS t ON s.`servertype`=t.`id` WHERE g.`id`=? AND g.`userid`=? AND g.`resellerid`=? LIMIT 1");
$query->execute(array($aeskey, $aeskey, $ui->id('id', 10, 'get'), $user_id, $resellerLockupID));
while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
    if ($ui->escaped('cmd', 'post')) {
        $appServer = new AppServer($row['rootID']);
        $appServer->getAppServerDetails($ui->id('id', 10, 'get'));
        $appServer->shellCommand($ui->escaped('cmd', 'post'));
        $appServer->execute();
    } else {
        $shorten = $row['shorten'];
        $ftppass = $row['dftppass'];
        $username = $row['newlayout'] == 'Y' ? $row['cname'] . '-' . $row['id'] : $row['cname'];
        if ($row['protected'] == 'N' and $row['servertemplate'] > 1) {
            $shorten .= '-' . $row['servertemplate'];
            $pserver = 'server/';
        } else {
            if ($row['protected'] == 'Y') {
                $username .= '-p';
                $ftppass = $row['decryptedftppass'];
                $pserver = '';
            } else {
                $pserver = 'server/';