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

Modules/ScormAicc/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 
00032 chdir("../..");
00033 require_once "./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php";
00034 
00035 // debug
00036 /*
00037 $fp=fopen("./Modules/ScormAicc/log/scorm.log", "a+");
00038 foreach ($HTTP_POST_VARS as $key=>$value)
00039         fputs($fp, "HTTP_POST_VARS[$key] = $value \n");
00040 foreach ($HTTP_GET_VARS as $key=>$value)
00041         fputs($fp, "HTTP_GET_VARS[$key] = $value \n");
00042 fclose($fp);
00043 */
00044 
00045 $cmd = ($_GET["cmd"] == "")
00046         ? $_POST["cmd"]
00047         : $_GET["cmd"];
00048 
00049 $ref_id=$_GET["ref_id"];
00050 
00051 //get type of cbt
00052 if (!empty($ref_id))
00053 {
00054         require_once "./include/inc.header.php";
00055 
00056         $obj_id = ilObject::_lookupObjectId($ref_id);
00057         $type = ilObjSAHSLearningModule::_lookupSubType($obj_id);
00058 
00059 }
00060 else
00061 {
00062 
00063         //ensure HACP
00064         $requiredKeys=array("command", "version", "session_id");
00065         if (count(array_diff ($requiredKeys, array_keys(array_change_key_case($HTTP_POST_VARS, CASE_LOWER))))==0)
00066         {
00067                 //now we need to get a connection to the database and global params
00068                 //but that doesnt work because of missing logindata of the contentserver
00069                 //require_once "./include/inc.header.php";
00070 
00071                 //highly insecure
00072                 $param=urldecode($HTTP_POST_VARS["session_id"]);
00073                 if (!empty($param) && substr_count($param, "_")==2)
00074                 {
00075                         list($session_id, $ref_id, $obj_id)=explode("_",$param);
00076 
00077 //                      session_id($session_id);
00078                         require_once "./include/inc.header.php";
00079 //$ilLog->write("Session: ".$HTTP_POST_VARS["session_id"]);
00080 
00081                         $type="hacp";
00082 
00083                 }
00084         }
00085 }
00086 
00087 switch ($type)
00088 {
00089         case "scorm":
00090                                 //SCORM
00091                                 require_once "./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php";
00092                                 $track = new ilObjSCORMTracking();
00093                                 $track->$cmd();
00094                                 break;
00095         case "aicc":
00096                                 //AICC
00097                                 require_once "./Modules/ScormAicc/classes/AICC/class.ilObjAICCTracking.php";
00098                                 $track = new ilObjAICCTracking();
00099                                 $track->$cmd();
00100                                 break;
00101         case "hacp":
00102                                 //HACP
00103                                 require_once "./Modules/ScormAicc/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("./Modules/ScormAicc/log/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 17:56:52 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1