ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
sahs_server.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
32 chdir("../..");
33 require_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
34 
35 $cmd = ($_GET["cmd"] == "")
36  ? $_POST["cmd"]
37  : $_GET["cmd"];
38 
39 $ref_id=$_GET["ref_id"];
40 
41 //get type of cbt
42 if (!empty($ref_id))
43 {
44  require_once "./include/inc.header.php";
45 
48 
49 }
50 else
51 {
52 
53  //ensure HACP
54  $requiredKeys=array("command", "version", "session_id");
55  if (count(array_diff ($requiredKeys, array_keys(array_change_key_case($_POST, CASE_LOWER))))==0)
56  {
57  //now we need to get a connection to the database and global params
58  //but that doesnt work because of missing logindata of the contentserver
59  //require_once "./include/inc.header.php";
60 
61  //highly insecure
62  $param=urldecode($_POST["session_id"]);
63  if (!empty($param) && substr_count($param, "_")==3)
64  {
65  list($session_id, $client_id, $ref_id, $obj_id)=explode("_",$param);
66 
67  $_COOKIE[session_name()] = $session_id;
68  $_COOKIE['ilClientId'] = $client_id;
69 
70 // session_id($session_id);
71  require_once "./include/inc.header.php";
72 //$ilLog->write("Session: ".$_POST["session_id"]);
73 
74  $type="hacp";
75 
76  }
77  }
78 }
79 
80 switch ($type)
81 {
82  case "scorm":
83  //SCORM
84  require_once "./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php";
85  $track = new ilObjSCORMTracking();
86  $track->$cmd();
87  break;
88  case "aicc":
89  //AICC
90  require_once "./Modules/ScormAicc/classes/AICC/class.ilObjAICCTracking.php";
91  $track = new ilObjAICCTracking();
92  $track->$cmd();
93  break;
94  case "hacp":
95  //HACP
96  require_once "./Modules/ScormAicc/classes/HACP/class.ilObjHACPTracking.php";
97  $track = new ilObjHACPTracking($ref_id, $obj_id);
98  //$track->$cmd();
99  break;
100  default:
101  //unknown type
102  $GLOBALS['ilLog']->write('sahs_server.php: unknown type >'.$type.'<');
103 }
104 
105 exit;
106 
107 ?>