예제 #1
0
function display_products($products, $customer_info, $list_style = 1, $expired_message)
{
    $txn_id = $customer_info['txn_id'];
    if (download_is_expired($customer_info['expire_date'])) {
        if ($expired_message != '') {
            $download_list = "<p id='expired'>{$expired_message}</p>";
        } else {
            $download_list = "<p id='expired'>Your download has expired</p>";
        }
    } else {
        $download_list = "<ul id='dlist'>\n";
        foreach ($products as $id => $product) {
            if ($list_style == 1) {
                $download_list .= "<li>{$product['name']} <small>[ <a href='dl.php?id={$txn_id}&file={$id}'>DOWNLOAD</a> ]</small></li>\n";
            } else {
                $download_list .= "<li><a href='dl.php?id={$txn_id}&file={$id}'>{$product['name']}</a></li>\n";
            }
        }
        $download_list .= "</ul>";
    }
    return $download_list;
}
예제 #2
0
파일: dl.php 프로젝트: klieon/simple-ipn
if (in_array($customer_file, $no_files)) {
    die('<h1>FATAL ERROR: Unauthorized Access</h1>');
}
if (file_exists($customer_file)) {
    include $customer_file;
} else {
    die('Purchase Details Not Found. Contact Administrator.');
}
if ($_GET['file'] == '') {
    die('Invalid File Information. Contact Administrator.');
}
$file_id = (int) $_GET['file'];
if (!isset($product_files[$file_id])) {
    die('Invalid File Information. Contact Administrator.');
}
$file = $product_files[$file_id];
if (download_is_expired($customer_info['expire_date'])) {
    die('Download has expired.');
}
if (file_exists($file['source'])) {
    $download = new downloader();
    $download->set_byfile($file['source']);
    $download->mime = '';
    $download->use_resume = true;
    //Enable Resume Mode
    $download->filename = $file['filename'];
    $download->download();
    exit;
} else {
    die("Download file ID {$file_id} is not valid. Please contact webmaster.");
}