if (isset($_POST['name'])) {
            $this_user_server = new user_server();
            $this_user_server->get_from_hashrange($u->id_user, $_POST['name']);
            if ($this_user_server->id_user != "undefined") {
                $this_user_server->update(array('int_online' => '0'));
            }
        }
    }
}
if (isset($_GET['action'])) {
    if ($_GET['action'] == 'server-online') {
        if (isset($_POST['name'])) {
            $this_user_server = new user_server();
            $this_user_server->get_from_hashrange($u->id_user, $_POST['name']);
            if ($this_user_server->id_user != "undefined") {
                $this_user_server->update(array('int_online' => '1'));
            }
        }
    }
}
if (isset($_GET['action'])) {
    if ($_GET['action'] == "update-uploaded-file") {
        if (isset($_POST['str_targetfile']) && isset($_POST['id_hf']) && isset($_POST['id'])) {
            if (strlen($_POST['id_hf']) > 0 && strlen($_POST['id']) > 0) {
                $this_hf_file = new hf_file();
                $this_hf_file->get_from_hashrange($_POST['id_hf'], $_POST['id']);
                if (isset($_POST['btnDelete'])) {
                    $this_hf_file->delete();
                } else {
                    if ($this_hf_file->id != 'undefined') {
                        $new_props = array();
Exemple #2
0
         if (count($ready_servers) > 0) {
             usort($ready_servers, "lastpingordersort");
             $assigner_setting->update(array("val" => $ready_servers['name']));
         }
     }
     // END IF (CURRENT REASSIGNER HAS NOT PINGED IN THE PAST 5 MINUTES)
 } else {
     $assigner_setting->update(array("val" => $INSTANCE_NAME));
 }
 // RE-ASSIGN WAITING JOBS IF THIS SERVER HAS NO JOBS OF ITS OWN TO PROCESS
 if (($new_job_news->id_user == "undefined" || $new_job_news->id_user == "") && $do_reassign_occasionally && $is_reassign_server) {
     //$JOB->update(array("id_status"=>"failed"));
     $SECONDS_SINCE_EPOCH = get_time();
     $user_server_update = new user_server();
     $user_server_update->get_from_hashrange($id_user, $INSTANCE_NAME);
     $user_server_update->update(array("last_ping" => $SECONDS_SINCE_EPOCH, "is_busy" => "0"));
     $user_servers = array();
     $user_server_check = new user_server();
     // LIST OF ALL JOB SERVERS
     $user_server_checks = $user_server_check->get_from_hashrange($id_user);
     // HOW MANY NON-BUSY JOB SERVERS
     $not_busy_servers = array();
     foreach ($user_server_checks as $user_server_check) {
         if (isset($user_server_check['is_busy'])) {
             if ($user_server_check['is_busy'] . "" != "1") {
                 $not_busy_servers[] = $user_server_check;
             }
         }
     }
     // HOW MANY OTHER NON-BUSY JOB SERVERS (INC. THIS ONE) WERE LAST SEEN IN THE PAST 30 SECONDS
     $server_second_timerange = 30;