Example #1
0
$timeconfig = $setUp->getConfig('default_timezone');
$timezone = strlen($timeconfig) > 0 ? $timeconfig : "UTC";
date_default_timezone_set($timezone);
$downloader = new Downloader();
$utils = new Utils();
$logger = new Logger();
$actions = new Actions();
$getcloud = $_POST["setdel"];
$hash = filter_input(INPUT_POST, "h", FILTER_SANITIZE_STRING);
$doit = filter_input(INPUT_POST, "doit", FILTER_SANITIZE_STRING);
$time = filter_input(INPUT_POST, "t", FILTER_SANITIZE_STRING);
if ($doit != $time * 12) {
    die('Direct access not permitted');
}
$alt = $setUp->getConfig('salt');
$altone = $setUp->getConfig('session_name');
if ($hash && $time && $gateKeeper->isUserLoggedIn() && $gateKeeper->isAllowed('delete_enable')) {
    if (md5($alt . $time) === $hash && $downloader->checkTime($time) == true) {
        foreach ($getcloud as $pezzo) {
            if ($downloader->checkFile($pezzo) == true) {
                $myfile = "../" . urldecode(base64_decode($pezzo));
                $actions->deleteMulti($myfile);
            }
        }
        echo "ok";
    } else {
        echo "Action expired";
    }
} else {
    echo "Not enough data";
}
Example #2
0
$getfile = filter_input(INPUT_GET, "q", FILTER_SANITIZE_STRING);
$getfilelist = filter_input(INPUT_GET, "dl", FILTER_SANITIZE_STRING);
$getcloud = filter_input(INPUT_GET, "d", FILTER_SANITIZE_STRING);
$hash = filter_input(INPUT_GET, "h", FILTER_SANITIZE_STRING);
$supah = filter_input(INPUT_GET, "sh", FILTER_SANITIZE_STRING);
$playmp3 = filter_input(INPUT_GET, "audio", FILTER_SANITIZE_STRING);
$getpass = filter_input(INPUT_GET, "pw", FILTER_SANITIZE_STRING);
if ($getpass) {
    $getpass = urldecode($getpass);
}
$alt = $setUp->getConfig('salt');
$altone = $setUp->getConfig('session_name');
$maxfiles = $setUp->getConfig('max_zip_files');
$maxfilesize = $setUp->getConfig('max_zip_filesize');
$useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
if ($getfile && $hash && $supah && $downloader->checkFile($getfile) == true && md5($hash . $alt . $getfile) === $supah) {
    /**
     * download single file 
     * (for non-logged users)
     */
    $headers = $downloader->getHeaders($getfile);
    // download file if Android
    if (stripos($useragent, 'android') !== false) {
        $downloader->androidDownload($headers['file'], $headers['filename'], $headers['file_size']);
    } else {
        // resumable download
        $downloader->resumableDownload($headers['file'], $headers['filename'], $headers['file_size'], $headers['content_type'], $headers['disposition']);
    }
    $logger->logDownload($headers['trackfile']);
    exit;
} elseif ($getfile && $hash && $downloader->checkFile($getfile) == true && md5($alt . $getfile . $altone . $alt) === $hash) {