Пример #1
0
 if ($row2['action'] == 'dl') {
     $appServer->stopAppHard();
     $appServer->userCud('del', 'both');
     $query4->execute(array($row2['affectedID']));
     customColumns('G', $row2['affectedID'], 'del');
     $query5->execute(array($row2['jobID']));
     $command = $gsprache->del . ' gsswitchID: ' . $row2['affectedID'] . ' name:' . $row2['name'] . ' gsswitchID:' . $row2['affectedID'];
 } else {
     if ($row2['action'] == 'ad' or $row2['action'] == 'md' and is_object($extraData)) {
         $installGames = (is_object($extraData) and property_exists($extraData, 'installGames') and preg_match('/[APN]/', $extraData->installGames)) ? $extraData->installGames : 'N';
         // userCrud will set the user to inactive
         $appServer->userCud('add');
         $appServer->setQuota();
         if ($row2['action'] == 'ad') {
             if ($installGames == 'P') {
                 $appServer->addApp(array(), true);
             } else {
                 if ($installGames == 'A') {
                     $templates = array();
                     $query6->execute(array($row2['affectedID']));
                     while ($row = $query6->fetch(PDO::FETCH_ASSOC)) {
                         $templates[] = $row['shorten'];
                         $templates[] = $row['shorten'] . '-2';
                         $templates[] = $row['shorten'] . '-3';
                     }
                     $appServer->addApp($templates, true);
                 }
             }
             $command = $gsprache->add . ' gsswitchID: ' . $row2['affectedID'] . ' name:' . $row2['name'] . ' gsswitchID:' . $row2['affectedID'];
         } else {
             $removeGames = property_exists($extraData, 'gamesRemoveArray') ? (array) $extraData->gamesRemoveArray : array();
Пример #2
0
         $templates = array($shorten, $shorten . '-2', $shorten . '-3');
     } else {
         if ($template == 1) {
             $templates = array($shorten);
         } else {
             $templates = array($shorten . '-' . $template);
         }
     }
     if ($ui->active('type', 'post') == 'Y') {
         $appServer->stopAppHard();
         $appServer->removeApp($templates);
         $loguseraction = "%reinstall% %gserver% {$appServer->appServerDetails['serverIP']}:{$appServer->appServerDetails['port']}";
     } else {
         $loguseraction = "%resync% %gserver% {$appServer->appServerDetails['serverIP']}:{$appServer->appServerDetails['port']}";
     }
     $appServer->addApp($templates);
     $appServer->execute();
     $template_file = $sprache->server_installed;
     if (isset($dbConnect['debug']) and $dbConnect['debug'] == 1) {
         $template_file .= '<br><pre>' . implode("\r\n", $appServer->debug()) . '</pre>';
     }
 } else {
     $shorten = '';
     $selected2 = '';
     $selected3 = '';
     $query = $sql->prepare("SELECT `serverid` FROM `gsswitch` WHERE `id`=? AND `resellerid`=?");
     $query->execute(array($id, $resellerLockupID));
     $currentID = $query->fetchColumn();
     $query = $sql->prepare("SELECT s.*,t.`description`,t.`shorten` FROM `serverlist` s INNER JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE s.`switchID`=? AND s.`resellerid`=?");
     $query->execute(array($id, $resellerLockupID));
     while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
Пример #3
0
             $appServer->getAppServerDetails($row3['switchID']);
             if ($row3['restart'] == 'N' and $row3['worldsafe'] == 'Y') {
                 $appServer->mcWorldSave();
                 echo 'MC worldsave: ' . $row2['server'] . "\r\n";
             }
             if ($row3['restart'] == 'N' and $row3['upload'] == 'Y') {
                 $appServer->demoUpload();
                 echo 'Demo upload for: ' . $row2['server'] . "\r\n";
             }
             if ($row3['restart'] == 'Y') {
                 if ($row3['protected'] == 'Y' and $row2['protected'] == 'N') {
                     $appServer->stopAppHard();
                     $query6->execute(array(passwordgenerate(20), $aeskey, $row3['switchID']));
                     $appServer->getAppServerDetails($row3['switchID']);
                     $appServer->removeApp($row3['template']);
                     $appServer->addApp($row3['template']);
                 }
                 $appServer->startApp();
                 echo 'Restarting server: ' . $row2['server'] . "\r\n";
             }
             if ($row3['backup'] == 'Y') {
                 $appServer->backupCreate($row2['backup']);
                 echo 'Backup server: ' . $row2['server'] . "\r\n";
             }
         }
     }
     $appServer->execute();
     if (isset($dbConnect['debug']) and $dbConnect['debug'] == 1) {
         print implode("\r\n", $appServer->debug()) . "\r\n";
     }
 }
Пример #4
0
             $appServer->getAppServerDetails($serverID);
             $appServer->userCud('add');
             $appServer->stopAppHard();
             $query->execute(array($serverID));
             while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
                 $removeTemplates[] = $row['shorten'];
                 $removeTemplates[] = $row['shorten'] . '-2';
                 $removeTemplates[] = $row['shorten'] . '-3';
             }
             if (count($removeTemplates) > 0) {
                 $appServer->removeApp($removeTemplates);
             }
             $query2->execute(array($serverID));
             while ($row = $query2->fetch(PDO::FETCH_ASSOC)) {
                 $started[] = $row['serverip'] . ':' . $row['port'];
                 $appServer->addApp(array(), true);
             }
         }
         if (count($started) > 0) {
             $template_file = $gsSprache->reinstall . ': ' . implode('<br>', $started);
             $appServer->execute();
             if (isset($dbConnect['debug']) and $dbConnect['debug'] == 1) {
                 $template_file .= '<br><pre>' . implode("\r\n", $appServer->debug()) . '</pre>';
             }
         } else {
             $template_file = 'admin_404.tpl';
         }
     } else {
         $template_file = 'admin_404.tpl';
     }
 }
Пример #5
0
                     $templates = array($shorten, $shorten . '-2', $shorten . '-3');
                 } else {
                     if ($template == 1) {
                         $templates = array($shorten);
                     } else {
                         $templates = array($shorten . '-' . $template);
                     }
                 }
                 if ($ui->active('type', 'post') == 'Y') {
                     $appServer->stopAppHard();
                     $appServer->removeApp($templates);
                     $loguseraction = "%reinstall% %gserver% {$serverip}:{$port}";
                 } else {
                     $loguseraction = "%resync% %gserver% {$serverip}:{$port}";
                 }
                 $appServer->addApp($templates, true);
                 $appServer->execute();
                 $template_file = $sprache->server_installed;
                 if (isset($dbConnect['debug']) and $dbConnect['debug'] == 1) {
                     $template_file .= '<br><pre>' . implode("\r\n", $appServer->debug()) . '</pre>';
                 }
                 $insertlog->execute();
             } else {
                 $template_file = 'admin_404.tpl';
             }
         } else {
             $template_file = 'admin_404.tpl';
         }
     }
     // Gameserver Restart
 } else {
        $query->execute(array($id, $resellerLockupID));
        $ftp = new EasyWiFTP($appServer->appMasterServerDetails['ssh2IP'], $appServer->appMasterServerDetails['ftpPort'], $appServer->appServerDetails['userNameExecute'], $appServer->appServerDetails['ftpPasswordExecute']);
        if ($ftp->loggedIn) {
            $ftp->downloadToTemp($appServer->appServerDetails['absoluteFTPPath'], 0, $files);
        }
        $query = $sql->prepare("UPDATE `gsswitch` SET `protected`=? WHERE `id`=? LIMIT 1");
        $query->execute(array($protected, $id));
        $appServer->getAppServerDetails($id);
        if ($ftp->loggedIn) {
            $ftp->createSecondFTPConnect($appServer->appMasterServerDetails['ssh2IP'], $appServer->appMasterServerDetails['ftpPort'], $appServer->appServerDetails['userNameExecute'], $appServer->appServerDetails['ftpPasswordExecute']);
            if ($ftp->secondLoggedIn) {
                $ftp->uploadFileFromTemp($appServer->appServerDetails['absoluteFTPPath']);
            }
        }
        if ($appServer->appServerDetails['protectionModeStarted'] == 'Y') {
            $query = $sql->prepare("UPDATE `gsswitch` SET `ppassword`=AES_ENCRYPT(?,?),`psince`=NOW() WHERE `id`=? LIMIT 1");
            $query->execute(array(passwordgenerate(10), $aeskey, $id));
            $appServer->getAppServerDetails($id);
            $appServer->userCud('add');
            $appServer->removeApp(array($appServer->appServerDetails['app']['templateChoosen']));
            $appServer->addApp();
        }
        $ftp = null;
        $appServer->startApp();
        $appServer->execute();
        $insertlog->execute();
        if (isset($dbConnect['debug']) and $dbConnect['debug'] == 1) {
            $template_file .= '<br><pre>' . implode("\r\n", $appServer->debug()) . '</pre>';
        }
    }
}