Esempio n. 1
0
    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) {
    /**
     * download single file, 
     * play Audio or show PDF 
     * (for logged users)
     */
    $headers = $downloader->getHeaders($getfile, $playmp3);
    if ($gateKeeper->isUserLoggedIn() && $downloader->subDir($headers['dirname']) == true || $gateKeeper->isLoginRequired() == false) {
        // 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']);
        }
        if ($headers['content_type'] == "audio/mp3") {
            $logger->logPlay($headers['trackfile']);
        } else {
            $logger->logDownload($headers['trackfile']);
        }
        exit;
    }
    $_SESSION['error'] = "<i class=\"fa fa-ban\"></i> Access denied";