• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

content/sahs_server.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00033 chdir("..");
00034 require_once "./content/classes/class.ilObjSAHSLearningModule.php";
00035 
00036 // debug
00037 /*
00038 $fp=fopen("./content/scorm.log", "a+");
00039 foreach ($HTTP_POST_VARS as $key=>$value)
00040         fputs($fp, "HTTP_POST_VARS[$key] = $value \n");
00041 foreach ($HTTP_GET_VARS as $key=>$value)
00042         fputs($fp, "HTTP_GET_VARS[$key] = $value \n");
00043 fclose($fp);
00044 */
00045 
00046 $cmd = ($_GET["cmd"] == "")
00047         ? $_POST["cmd"]
00048         : $_GET["cmd"];
00049 
00050 $ref_id=$_GET["ref_id"];
00051 
00052 //get type of cbt
00053 if (!empty($ref_id))
00054 {
00055         require_once "./include/inc.header.php";
00056 
00057         $obj_id = ilObject::_lookupObjectId($ref_id);
00058         $type = ilObjSAHSLearningModule::_lookupSubType($obj_id);
00059 
00060 }
00061 else
00062 {
00063 
00064         //ensure HACP
00065         $requiredKeys=array("command", "version", "session_id");
00066         if (count(array_diff ($requiredKeys, array_keys(array_change_key_case($HTTP_POST_VARS, CASE_LOWER))))==0)
00067         {
00068                 //now we need to get a connection to the database and global params
00069                 //but that doesnt work because of missing logindata of the contentserver
00070                 //require_once "./include/inc.header.php";
00071 
00072                 //highly insecure
00073                 $param=urldecode($HTTP_POST_VARS["session_id"]);
00074                 if (!empty($param) && substr_count($param, "_")==2)
00075                 {
00076                         list($session_id, $ref_id, $obj_id)=explode("_",$param);
00077 
00078                         session_id($session_id);
00079                         require_once "./include/inc.header.php";
00080 
00081                         $type="hacp";
00082 
00083                 }
00084         }
00085 }
00086 
00087 switch ($type)
00088 {
00089         case "scorm":
00090                                 //SCORM
00091                                 require_once "./content/classes/SCORM/class.ilObjSCORMTracking.php";
00092                                 $track = new ilObjSCORMTracking();
00093                                 $track->$cmd();
00094                                 break;
00095         case "aicc":
00096                                 //AICC
00097                                 require_once "./content/classes/AICC/class.ilObjAICCTracking.php";
00098                                 $track = new ilObjAICCTracking();
00099                                 $track->$cmd();
00100                                 break;
00101         case "hacp":
00102                                 //HACP
00103                                 require_once "./content/classes/HACP/class.ilObjHACPTracking.php";
00104                                 $track = new ilObjHACPTracking($ref_id, $obj_id);
00105                                 //$track->$cmd();
00106                                 break;
00107         default:
00108                                 //unknown type
00109                                 $fp=fopen("./content/scorm.log", "a+");
00110                                 fputs($fp, "unknown type >$type< in sahs_server\n");
00111                                 foreach ($HTTP_POST_VARS as $k=>$v)
00112                                         fputs($fp, "HTTP_POST_VARS[$k]=$v \n");
00113                                 fclose($fp);
00114 }
00115 
00116 exit;
00117 
00118 ?>

Generated on Fri Dec 13 2013 09:06:36 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1