Exemplo n.º 1
0
function executeCron($service_id, $link, $params)
{
    echo "Executing for service {$service_id}\n";
    if (isset($params['skipcron'])) {
        echo "skipcron skipping\n";
        return;
    }
    echo "bancache\n";
    //ban cache
    if (!isset($params['cron_updateban']) || $params['cron_updateban'] == 1) {
        updateBan($link);
    }
    echo "uscore\n";
    //update scores
    $db_settings = databaseSettings($service_id);
    if (isset($params['cron_dotascores']) && $params['cron_dotascores'] == 1) {
        updateDotaScores($db_settings);
    }
    if (isset($params['cron_w3mmdscores']) && $params['cron_w3mmdscores'] == 1) {
        updateW3MMDScores($db_settings);
    }
    echo "ads\n";
    //announce ads
    if (isset($params['ads']) && $params['ads'] == 1) {
        displayAds($link);
    }
    echo "gametrack\n";
    //gametrack script
    if (!isset($params['cron_gametrack']) || $params['cron_gametrack'] == 1) {
        $nextPlayer = 0;
        if (isset($params['gametrack_next'])) {
            $nextPlayer = $params['gametrack_next'];
        }
        $nextPlayer = gameTrack($link, $nextPlayer);
        setServiceParam($service_id, "gametrack_next", $nextPlayer);
    }
}
Exemplo n.º 2
0
         } else {
             if ($_POST['action'] == "ghostdb" && isset($_POST['db_id'])) {
                 include "../include/database.php";
                 include "../include/ghost.php";
                 $db_settings = databaseSettings($_POST['db_id']);
                 if ($db_settings !== false) {
                     ghostSetDatabase($_REQUEST['id'], $db_settings);
                     $message = "Database settings should be set properly.";
                 } else {
                     $message = "Failed to find database settings for the specified database service.";
                 }
             } else {
                 if ($_POST['action'] == "channeldb" && isset($_POST['db_id'])) {
                     include "../include/database.php";
                     include "../include/channel.php";
                     $db_settings = databaseSettings($_POST['db_id']);
                     if ($db_settings !== false) {
                         channelSetDatabase($_REQUEST['id'], $db_settings);
                         $message = "Database settings should be set properly.";
                     } else {
                         $message = "Failed to find database settings for the specified database service.";
                     }
                 }
             }
         }
     }
     header("Location: service.php?id={$service_id}&message=" . urlencode($message));
 }
 $service = getService($service_id);
 $parameters = getServiceParams($service_id);
 get_page("service", "admin", array('id' => $service_id, 'service' => $service, 'parameters' => $parameters, 'message' => $message));