static function RunCronJobs()
 {
     Server::InitDataBlock(array("DBCONFIG"));
     $timeouts = array(Server::$Configuration->File["poll_frequency_clients"] * 10, 86400, 86400 * 7, DATA_LIFETIME);
     $randoms = array(0 => 600, 1 => 300, 2 => 20);
     $randStandard = rand(1, $randoms[0]);
     if ($randStandard < 5) {
         require_once LIVEZILLA_PATH . "_lib/functions.internal.optimize.inc.php";
         DatabaseMaintenance::Maintain($randStandard, $timeouts);
     }
     if (rand(1, $randoms[2]) == 1) {
         if (empty(Server::$Configuration->File["gl_rm_chats"]) || !empty(Server::$Configuration->File["gl_rm_chats_time"])) {
             Communication::SendChatTranscripts();
         }
     }
     if (rand(1, $randoms[2] - count(Server::$Configuration->Database["gl_email"])) <= 1) {
         Communication::DownloadEmails(false);
     }
     if (rand(1, $randoms[2] - count(Server::$Configuration->Database["gl_sm"])) <= 1) {
         Communication::DownloadSocialMedia(false);
     }
 }
Exemplo n.º 2
0
OperatorRequest::Validate();
if (OperatorRequest::IsValidated()) {
    CacheManager::GetDataUpdateTimes();
    if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_LISTEN || $_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_LOGIN) {
        Server::$Operators[CALLER_SYSTEM_ID]->SaveMobileParameters();
        OperatorRequest::Listen();
        if (STATS_ACTIVE && !LOGIN) {
            Server::$Statistic->ProcessAction(ST_ACTION_LOG_STATUS, array(Server::$Operators[CALLER_SYSTEM_ID]));
        }
    } else {
        if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_SEND_FILE) {
            OperatorRequest::UploadFile();
        } else {
            if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_OPTIMIZE_TABLES) {
                require LIVEZILLA_PATH . "_lib/functions.internal.optimize.inc.php";
                DatabaseMaintenance::Optimize($_POST["p_table"]);
            } else {
                if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_SEND_RESOURCES) {
                    require LIVEZILLA_PATH . "_lib/functions.internal.process.inc.php";
                    processUpdateReport();
                    processResources();
                } else {
                    if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_REPORTS) {
                        require LIVEZILLA_PATH . "_lib/functions.internal.process.inc.php";
                        require LIVEZILLA_PATH . "_lib/functions.internal.build.inc.php";
                        processUpdateReport();
                        buildReports();
                    } else {
                        if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_DATABASE_TEST) {
                            require_once LIVEZILLA_PATH . "_lib/functions.internal.man.inc.php";
                            ServerManager::DatabaseTest();