コード例 #1
0
function init_server()
{
    if (isset($_GET['key']) && isset($_GET['file'])) {
        $xsToken = new xsToken();
        if ($xsToken->isValid($_GET['file'], $_GET['key'])) {
            $file = $_GET['file'];
        } else {
            $file = 'no_access.jpg';
        }
        $config = array('file' => $file, 'file_path' => XS_FILES . '/protected_images/', 'force_download' => 0, 'burst_size' => 0, 'throttle' => 0, 'mime_types' => array('jpe' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'png' => 'image/png', 'svg' => 'image/svg+xml', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'gif' => 'image/gif'));
        return $config;
    } else {
        return false;
    }
}
コード例 #2
0
function init_server()
{
    if (isset($_GET['key']) && isset($_GET['media']) && isset($_GET['file'])) {
        $xsToken = new xsToken();
        switch ($_GET['media']) {
            case 'download':
                $file_path = '/downloads/';
                break;
            default:
                return false;
                break;
        }
        if ($xsToken->isValid($_GET['file'], $_GET['key'])) {
            $file = $_GET['file'];
        } else {
            return false;
        }
        $config = array('file' => $file, 'file_path' => XS_FILES . $file_path, 'force_download' => true, 'burst_size' => 0, 'throttle' => 500, 'mime_types' => array('swf' => 'application/x-shockwave-flash', 'flv' => 'video/x-flv', 'mp4' => 'video/mp4', 'f4v' => 'video/mp4', 'f4p' => 'video/mp4', 'asf' => 'video/x-ms-asf', 'asr' => 'video/x-ms-asf', 'asx' => 'video/x-ms-asf', 'avi' => 'video/x-msvideo', 'mpa' => 'video/mpeg', 'mpe' => 'video/mpeg', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mpv2' => 'video/mpeg', 'mov' => 'video/quicktime', 'movie' => 'video/x-sgi-movie', 'mp2' => 'video/mpeg', 'qt' => 'video/quicktime', 'mp3' => 'audio/mpeg', 'wav' => 'audio/x-wav', 'aif' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', 'aiff' => 'audio/x-aiff', 'jpe' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'png' => 'image/png', 'svg' => 'image/svg+xml', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'gif' => 'image/gif', 'txt' => 'text/plain', 'xml' => 'text/xml', 'css' => 'text/css', 'htm' => 'text/html', 'html' => 'text/html', 'js' => 'application/x-javascript', 'pdf' => 'application/pdf', 'doc' => 'application/msword', 'vcf' => 'text/x-vcard', 'vrml' => 'x-world/x-vrml', 'zip' => 'application/zip'));
        return $config;
    } else {
        return false;
    }
}
コード例 #3
0
ファイル: index.php プロジェクト: vijo/xmoovstream
Author: Eric Lorenzo Benjamin jr. stream (AT) xmoov (DOT) com
License: Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License. http://stream.xmoov.com/support/licensing/
*/
@(include '../../libs/xmoovStream/include.php');
$p = isset($_GET["p"]) ? $_GET["p"] : null;
switch ($p) {
    case 'systeminfo':
        $xmoovStream = xmoovStream('helper');
        $page = "../xshelper/{$p}";
        break;
    case 'downloads':
        $xmoovStream = xmoovStream('file_info');
        $page = "pages/{$p}";
        break;
    case 'hotlink':
        $xsTokenHandler = new xsToken();
        $token = $xsTokenHandler->setToken('example.jpg');
    case 'flashmedia':
    case 'quicktimemedia':
    case 'audio':
    case 'resources':
        $page = "pages/{$p}";
        break;
    default:
        $p = 'welcome';
        $page = "pages/welcome";
        break;
}
$mod_rewrite = isset($_GET["rewrite"]) ? true : false;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">