changed git call from https to git readonly
[atutor.git] / mods / atutor_opencaps / opencaps / index.php
1 <?php
2 /*
3  * OpenCaps
4  * http://opencaps.atrc.utoronto.ca
5  * 
6  * Copyright 2009 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 require(INCLUDE_PATH.'vitals.inc.php');
17
18 //remote system request - send captions back
19 if (isset($_GET['id'])) {
20         $this_proj->id = $_GET['id'];
21         $_SESSION['pid'] = $this_proj->id;
22         
23         //check which system is pinging opencaps
24         if (isset($systems) && ACTIVE_SYSTEM != '') {
25                 
26                 /*$ref_url = substr($_SERVER['HTTP_REFERER'], 0, -(strlen($_SERVER['SCRIPT_FILENAME'])));
27                 
28                 echo $_SERVER['HTTP_REFERER'].' '.$_SERVER['HTTP_HOST'].'<br>';
29                 echo $systems[2]['url'].' '.$ref_url;
30                 exit; 
31                 
32                 foreach ($systems as $key=>$sys) {                      
33                         if (strpos($sys['url'], getenv("HTTP_REFERER"))) {
34                                 $sys_id = $key;
35                         }
36                 }*/
37                 
38                 $this_system->openProject($this_proj->id);
39                         
40
41         } else {
42                 $_SESSION['errors'][] = "External system URL not recognised. Make sure to add this system to the OpenCaps config file.";                
43                 header("Location:start.php");
44                 exit;
45         }
46         //$_SESSION['rid'] = $rid;
47         //$this_proj->openRemote($this_proj->id, true);
48
49 } else {
50         header("Location:start.php");
51         exit;
52 }
53
54 ?>