Example #1
0
    $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) {
    /**
     * 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