Ejemplo n.º 1
0
function stats_appliance_receive()
{
    $hostname = $_POST["HOSTNAME"];
    $sock = new sockets();
    $FILENAME = $_POST["FILENAME"];
    $SIZE = $_POST["SIZE"];
    $MD5FILE = $_POST["MD5FILE"];
    $UUID = null;
    if (isset($_POST["UUID"])) {
        $UUID = trim($_POST["UUID"]);
    }
    if ($UUID == null) {
        die("NO UUID!???");
    }
    $content_dir = dirname(__FILE__) . "/ressources/conf/upload/StatsApplianceLogs/{$UUID}";
    @mkdir($content_dir, 0755, true);
    if (!is_dir($content_dir)) {
        echo "{$content_dir}: Error Unable create directory..\n";
        echo "\n\n<RESULTS>FAILED</RESULTS>\n\n";
    }
    while (list($key, $arrayF) = each($_FILES)) {
        $type_file = $arrayF['type'];
        $name_file = $arrayF['name'];
        $tmp_file = $arrayF['tmp_name'];
        $target_file = "{$content_dir}/{$name_file}";
        if (file_exists($target_file)) {
            @unlink($target_file);
        }
        if (!move_uploaded_file($tmp_file, $target_file)) {
            print_r($arrayF);
            writelogs_stats("Error Unable to Move File : {$target_file} FROM {$GLOBALS["CLIENT_META_IP"]}", __FUNCTION__, __FILE__, __LINE__);
            echo "{$content_dir}: Error Unable to Move File : {$target_file}\n";
            echo "\n\n<RESULTS>FAILED</RESULTS>\n\n";
            return;
        }
        $size = @filesize($target_file);
        logsize($UUID, $GLOBALS["CLIENT_META_IP"], $hostname, $name_file, $size);
    }
    $md = md5_file($target_file);
    if ($md != $MD5FILE) {
        writelogs_stats("Error {$target_file}: Signature differ... FROM {$GLOBALS["CLIENT_META_IP"]}", __FUNCTION__, __FILE__, __LINE__);
        echo "{$target_file}: Signature differ...\n";
        echo "\n\n<RESULTS>FAILED</RESULTS>\n\n";
        return;
    }
    echo "\n\n<RESULTS>SUCCESS</RESULTS>\n\n";
    $sock->getFrameWork("squid.php?scan-proxy-logs=yes&uuid={$UUID}");
}
Ejemplo n.º 2
0
function receive_generic_file()
{
    if ($GLOBALS["UUID"] != null) {
        $uuid = $GLOBALS["UUID"];
    }
    if ($uuid == null) {
        die;
    }
    $meta = new mysql_meta();
    $sock = new sockets();
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "SYSLOG") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}/syslog";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            $filesize = $arrayF['size'];
            logsize($uuid, $name_file, $filesize);
            $name_file = $meta->uuid_to_host($uuid) . ".{$name_file}";
            $target_file = "{$UploadedDir}/{$name_file}";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}: Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$tmp_file}", __FUNCTION__, __FILE__, __LINE__);
                writelogs_meta("{$uuid}: Error Unable to Move File To: {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        $sock->getFrameWork("artica.php?meta-syslog-uuid=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
        return;
    }
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "PSAUX") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            $filesize = $arrayF['size'];
            logsize($uuid, $name_file, $filesize);
            $target_file = "{$UploadedDir}/{$name_file}";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}: Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        $sock->getFrameWork("artica.php?meta-psaux-uuid=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
        return;
        return;
    }
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "PHILESIGHT") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            $filesize = $arrayF['size'];
            logsize($uuid, $name_file, $filesize);
            $target_file = "{$UploadedDir}/{$name_file}";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}: Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        $sock->getFrameWork("artica.php?meta-philesight-uuid=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
        return;
    }
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "META_EVENTS") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}/META_EVENTS";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            $filesize = $arrayF['size'];
            logsize($uuid, $name_file, $filesize);
            $t = time();
            $target_file = "{$UploadedDir}/{$t}-{$name_file}";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}: Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        $sock->getFrameWork("artica.php?meta-metaevents-uuid=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
        return;
    }
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "SYS_ALERTS") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}/SYS_ALERTS";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            $filesize = $arrayF['size'];
            logsize($uuid, $name_file, $filesize);
            $t = time();
            $target_file = "{$UploadedDir}/{$t}-{$name_file}";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}: Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        $sock->getFrameWork("artica.php?meta-sysalerts-uuid=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
        return;
    }
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "SMTP_NOTIF") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}/SMTP_NOTIF";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            logsize($uuid, $name_file, $filesize);
            $t = time();
            $target_file = "{$UploadedDir}/{$t}-{$name_file}";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}: Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        $sock->getFrameWork("artica.php?meta-smtp-uuid=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
    }
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "SNAPSHOT") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}/SNAPSHOT";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            echo "SNAPSHOT: {$uuid}: Error Unable to create {$UploadedDir}\n";
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $filesize = $arrayF['size'];
            $tmp_file = $arrayF['tmp_name'];
            logsize($uuid, $name_file, $filesize);
            $t = time();
            $target_file = "{$UploadedDir}/{$t}-{$name_file}";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                $errorZ = error_get_last();
                $error_type = $errorZ["type"];
                $error_message = $errorZ["message"];
                echo "SNAPSHOT: {$uuid}: Error {$error_type} ({$error_message}) Unable to Move File : {$target_file}\n";
                writelogs_meta("SNAPSHOT: {$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                writelogs_meta("SNAPSHOT: {$uuid}: Source file was {$tmp_file}", __FUNCTION__, __FILE__, __LINE__);
                writelogs_meta("SNAPSHOT: {$uuid}: System error {$error_type} {$error_message}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        $sock->getFrameWork("artica.php?meta-snapshot-uuid=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
    }
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "ARTICA_DAEMONS") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            $filesize = $arrayF['size'];
            writelogs_meta("{$uuid}: ARTICA_DAEMONS -> {$uuid},{$name_file},{$filesize}", __FUNCTION__, __FILE__, __LINE__);
            logsize($uuid, $name_file, $filesize);
            $t = time();
            $target_file = "{$UploadedDir}/ARTICA_DAEMONS.gz";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}:ARTICA_DAEMONS Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
            $target_file_size = FormatBytes(@filesize($target_file) / 1024);
            writelogs_meta("{$uuid}: ARTICA_DAEMONS -> {$target_file} ({$target_file_size})", __FUNCTION__, __FILE__, __LINE__);
        }
        $sock->getFrameWork("artica.php?meta-metaclient-scan-upload-dirs=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
        return;
    }
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "CLIENT_META_EVENTS") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}/CLIENT_META_EVENTS";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            $filesize = $arrayF['size'];
            logsize($uuid, $name_file, $filesize);
            $t = time();
            $target_file = "{$UploadedDir}/{$t}-{$name_file}";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}: Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        $sock->getFrameWork("artica.php?meta-metaclientevents-uuid=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
        return;
    }
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "SQUID_QUOTASIZE") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}/SQUID_QUOTASIZE";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            $filesize = $arrayF['size'];
            logsize($uuid, $name_file, $filesize);
            $t = time();
            $target_file = "{$UploadedDir}/{$t}-{$name_file}";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}: Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        $sock->getFrameWork("artica.php?meta-metaclientquotasize-uuid=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
        return;
    }
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "SQUID_PERFS") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            $filesize = $arrayF['size'];
            logsize($uuid, $name_file, $filesize);
            $t = time();
            $target_file = "{$UploadedDir}/SQUID_PERFS.gz";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}: Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        $sock->getFrameWork("artica.php?meta-metaclient-scan-upload-dirs=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
        return;
    }
    //******************************************************************************************************************
    if ($_POST["INTERFACE_CACHE"] == "SQUID_PERFS") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            $filesize = $arrayF['size'];
            logsize($uuid, $name_file, $filesize);
            $t = time();
            $target_file = "{$UploadedDir}/INTERFACE_CACHE.gz";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}: Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        $sock->getFrameWork("artica.php?meta-metaclient-scan-upload-dirs=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
        return;
    }
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "EVENT_NOTIFY_MASTER") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}/EVENT_NOTIFY_MASTER";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            $filesize = $arrayF['size'];
            logsize($uuid, $name_file, $filesize);
            $t = time();
            $target_file = "{$UploadedDir}/{$t}-{$name_file}";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}: Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        $sock->getFrameWork("artica.php?meta-metaclienteventsmaster-uuid=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
        return;
    }
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "SQUID_RELATIME_EVENTS") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}/SQUID_RELATIME_EVENTS";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            $filesize = $arrayF['size'];
            logsize($uuid, $name_file, $filesize);
            $t = time();
            $target_file = "{$UploadedDir}/{$uuid}-{$t}-{$name_file}";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}: Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        $sock->getFrameWork("artica.php?meta-metaclientSquidRealtimeev-uuid=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
        return;
    }
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "PROXY_PORTS") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            $filesize = $arrayF['size'];
            logsize($uuid, $name_file, $filesize);
            $t = time();
            $target_file = "{$UploadedDir}/{$uuid}-{$t}-{$name_file}";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}: Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        $sock->getFrameWork("artica.php?meta-metaclient-dumpsql-uuid=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
        return;
    }
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "TABLE_NICS") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            $filesize = $arrayF['size'];
            logsize($uuid, $name_file, $filesize);
            $t = time();
            $target_file = "{$UploadedDir}/TABLE_NICS.gz";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}: Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        $sock->getFrameWork("artica.php?meta-metaclient-scan-upload-dirs=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
        return;
    }
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "HOTSPOT_SESSSIONS") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            $filesize = $arrayF['size'];
            logsize($uuid, $name_file, $filesize);
            $t = time();
            $target_file = "{$UploadedDir}/HOTSPOT_SESSSIONS.gz";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}: Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        if (HOTSPOT_SESSSIONS($target_file, $uuid)) {
            @unlink($target_file);
            echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
        }
        return;
    }
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "PROXY_CATEGORIES") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            $filesize = $arrayF['size'];
            logsize($uuid, $name_file, $filesize);
            $t = time();
            $target_file = "{$UploadedDir}/PROXY_CATEGORIES.gz";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}: Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        $sock->getFrameWork("artica.php?meta-metaclient-scan-upload-dirs=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
        return;
    }
    //******************************************************************************************************************
    if ($_POST["PUSH_FILE_CMD"] == "META_CLIENT_EVENTS") {
        $UploadedDir = "{$GLOBALS["HOSTS_PATH"]}/uploaded/{$uuid}";
        @mkdir($UploadedDir, 0755, true);
        if (!is_dir($UploadedDir)) {
            return false;
        }
        while (list($key, $arrayF) = each($_FILES)) {
            $type_file = $arrayF['type'];
            $name_file = $arrayF['name'];
            $tmp_file = $arrayF['tmp_name'];
            $filesize = $arrayF['size'];
            logsize($uuid, $name_file, $filesize);
            $t = time();
            $target_file = "{$UploadedDir}/META_CLIENT_EVENTS.gz";
            if (file_exists($target_file)) {
                @unlink($target_file);
            }
            if (!move_uploaded_file($tmp_file, $target_file)) {
                echo "{$uuid}: Error Unable to Move File : {$target_file}\n";
                writelogs_meta("{$uuid}: Error Unable to Move File : {$target_file}", __FUNCTION__, __FILE__, __LINE__);
                return;
            }
        }
        $sock->getFrameWork("artica.php?meta-metaclient-scan-upload-dirs=yes&uuid={$uuid}");
        echo "\n<ARTICAMETA>OK</ARTICAMETA>\n";
        return;
    }
    //******************************************************************************************************************
}