Пример #1
0
    $query->execute(array($currentHour, $lastUpdateRun, $currentMinute));
    while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
        $rootServer = new masterServer($row['id'], $aeskey);
        if ($row['updates'] == 3) {
            echo "Updates deactivated for: " . $rootServer->sship . "\r\n";
        } else {
            if (4 == $currentHour) {
                $rootServer->collectData(true, true, false);
            } else {
                $rootServer->collectData();
            }
            $sshReturn = $rootServer->sshConnectAndExecute();
            if ($sshReturn === false and $rootServer->updateAmount > 0) {
                echo "Updating failed for: " . $rootServer->sship . "\r\n";
            } else {
                if ($rootServer->updateAmount > 0) {
                    echo "Updater started for " . $rootServer->sship . "\r\n";
                    if (isset($dbConnect['debug']) and $dbConnect['debug'] == 1) {
                        print_r($rootServer->getCommands());
                    }
                } else {
                    echo "No updates to be executed for " . $rootServer->sship . "\r\n";
                }
            }
            $query2->execute(array($currentHour, $row['id']));
            $rootServer = null;
        }
    }
    $query = $sql->prepare("UPDATE `settings` SET `lastCronUpdates`=UNIX_TIMESTAMP()");
    $query->execute();
}
Пример #2
0
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());
    }
}
Пример #3
0
         $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'];
     }
     $query = $sql->prepare("SELECT r.`id`,s.`shorten`,s.`description` FROM `rservermasterg` r INNER JOIN `servertypes` s ON r.`servertypeid`=s.`id` WHERE r.`serverid`=? AND r.`resellerid`=? ORDER BY `description`");
     $query->execute(array($id, $resellerLockupID));