if (!defined('AJAXINCLUDED')) {
    die('Do not access directly!');
}
include EASYWIDIR . '/stuff/methods/functions_ssh_exec.php';
include EASYWIDIR . '/stuff/methods/class_masterserver.php';
include EASYWIDIR . '/stuff/keyphrasefile.php';
$gamelist = array();
$sprache = getlanguagefile('roots', $user_language, $resellerLockupID);
$rootServer = new masterServer($ui->id('serverID', 10, 'get'), $aeskey);
$query = $sql->prepare("SELECT `shorten` FROM `servertypes` WHERE `id`=? AND `resellerid`=? LIMIT 1");
foreach ($ui->id('masterIDs', 10, 'get') as $masterID) {
    $query->execute(array($masterID, $resellerLockupID));
    $gameShorten = $query->fetchColumn();
    if (strlen($gameShorten) > 0) {
        $gamelist[] = $gameShorten;
        $rootServer->collectData($masterID, true);
    }
}
$return = $rootServer->sshConnectAndExecute();
if (count($gamelist) == 0) {
    echo 'Nothing to update/sync!';
} else {
    if ($return === false) {
        echo $sprache->error_root_updatemaster . ' ( ' . implode(', ', $gamelist) . ' )';
    } else {
        echo $sprache->root_updatemaster . ' ( ' . implode(', ', $gamelist) . ' )';
    }
    if (isset($dbConnect['debug']) and $dbConnect['debug'] == 1) {
        echo '<br>' . nl2br($rootServer->getCommands());
    }
}
Esempio n. 2
0
 if ($ui->smallletters('action', 2, 'post') == 'dl') {
     $rootServer = new masterServer($ui->id('id', 10, 'get'), $aeskey);
     if ($ui->id('id', 10, 'post')) {
         $template_file = '';
         $query = $sql->prepare("SELECT s.`shorten` FROM `rservermasterg` r INNER JOIN `servertypes` s ON r.`servertypeid`=s.`id` WHERE r.`id`=? AND r.`resellerid`=? LIMIT 1");
         $query2 = $sql->prepare("DELETE FROM `rservermasterg` WHERE `id`=? AND `resellerid`=? LIMIT 1");
         foreach ($ui->id('id', 10, 'post') as $id) {
             $query->execute(array($id, $resellerLockupID));
             $shorten = $query->fetchColumn();
             $rootServer->masterRemove($shorten);
             $query2->execute(array($id, $resellerLockupID));
             $template_file .= $spracheResponse->table_del . ': ' . $shorten . '<br />';
             $loguseraction = '%del% %master% ' . $rootServer->sship . ' ' . $shorten;
             $insertlog->execute();
         }
         $rootServer->sshConnectAndExecute(false);
         $template_file .= $sprache->root_masterdel;
         if (isset($dbConnect['debug']) and $dbConnect['debug'] == 1) {
             $template_file .= '<br>' . nl2br($rootServer->getCommands());
         }
     } else {
         $template_file = $sprache->error_root_noselect;
     }
 } else {
     $table = array();
     $id = $ui->id('id', 19, 'get');
     $query = $sql->prepare("SELECT `ip`,`description` FROM `rserverdata` WHERE `active`='Y' AND `id`=? AND `resellerid`=? LIMIT 1");
     $query->execute(array($id, $resellerLockupID));
     while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
         $ip = $row['ip'];
         $description = $row['description'];