2b004b9de0b1e261336dead52a5d6620196cb181
[atutor.git] / mods / atutor_opencaps / opencaps / loadmedia.php
1 <?php
2 /*
3  * OpenCaps
4  * http://opencaps.atrc.utoronto.ca
5  * 
6  * Copyright 2010 Heidi Hazelton
7  * Adaptive Technology Resource Centre, University of Toronto
8  * 
9  * Licensed under the Educational Community License (ECL), Version 2.0. 
10  * You may not use this file except in compliance with this License.
11  * http://www.opensource.org/licenses/ecl2.php
12  * 
13  */
14
15 define('INCLUDE_PATH', 'include/');
16
17 require(INCLUDE_PATH.'vitals.inc.php');
18
19
20 $file = $_GET['loc'];
21
22 if (isset($_SESSION['rid'])) {
23         $uri = explode($remote_systems[$_SESSION["rid"]]['url'], $file);
24         $uri = $uri[1];
25         $file = matterhornAuth($_SESSION["rid"], $uri, "media");
26 }
27
28 header('Pragma: public');
29 header('Expires: 0');
30 header('Cache-Control: must-revalidate, post-check=0, pre-check');
31 header('Cache-Control: private', false);
32 header('Content-Type: video/quicktime');
33 header('Content-Transfer-Encoding: binary');
34 header('Content-Length: '.filesize($file));
35
36 readfile($file);
37 exit;
38
39
40
41
42
43
44
45
46
47 /*
48
49 loadMedia(urldecode($_GET['loc']));
50
51 function loadMedia($loc) {
52         global $remote_systems;
53                         
54         //if matterhorn
55         if (isset($_SESSION["rid"])) {
56                 $uri = explode($remote_systems[$_SESSION["rid"]]['url'], $loc);
57                 $uri = $uri[1];
58                 return matterhornAuth($rid, $uri, "media");
59         
60         } else {
61                 return readfile($loc);
62         }
63 }*/
64
65
66 ?>