ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
goto.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
16 //var_dump ($_SESSION);
17 //var_dump ($_COOKIE);
18 
19 // this should bring us all session data of the desired
20 // client
21 if (isset($_GET["client_id"]))
22 {
23  $cookie_domain = $_SERVER['SERVER_NAME'];
24  $cookie_path = dirname( $_SERVER['PHP_SELF'] );
25 
26  /* if ilias is called directly within the docroot $cookie_path
27  is set to '/' expecting on servers running under windows..
28  here it is set to '\'.
29  in both cases a further '/' won't be appended due to the following regex
30  */
31  $cookie_path .= (!preg_match("/[\/|\\\\]$/", $cookie_path)) ? "/" : "";
32 
33  if($cookie_path == "\\") $cookie_path = '/';
34 
35  $cookie_domain = ''; // Temporary Fix
36 
37  setcookie("ilClientId", $_GET["client_id"], 0, $cookie_path, $cookie_domain);
38 
39  $_COOKIE["ilClientId"] = $_GET["client_id"];
40 }
41 
42 require_once "./include/inc.header.php";
43 
44 // special handling for direct navigation request
45 require_once "./Services/Navigation/classes/class.ilNavigationHistoryGUI.php";
47 $nav_hist->handleNavigationRequest();
48 
49 if(strpos($_GET['target'], 'purchasetypedemo') !== false)
50 {
51  $_GET['purchasetype'] = 'demo';
52  $_GET['cmd'] = 'showDemoVersion';
53  $_GET['target'] = str_replace('purchasetypedemo', '', $_GET['target']);
54 }
55 else if(strpos($_GET['target'], 'purchasetypebuy') !== false)
56 {
57  $_GET['purchasetype'] = 'buy';
58  $_GET['cmd'] = 'showDetails';
59  $_GET['target'] = str_replace('purchasetypebuy', '', $_GET['target']);
60 }
61 
62 $r_pos = strpos($_GET["target"], "_");
63 $rest = substr($_GET["target"], $r_pos+1);
64 
65 $target_arr = explode("_", $_GET["target"]);
68 $additional = $target_arr[2]; // optional for pages
69 
70 
71 // if anonymous and goto is not granted: go to login page
72 include_once("Services/Init/classes/class.ilStartUpGUI.php");
73 if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID && !ilStartUpGUI::_checkGoto($_GET["target"]))
74 {
75  ilUtil::redirect("login.php?target=".$_GET["target"]."&cmd=force_login&lang=".$ilUser->getCurrentLanguage());
76 }
77 
78 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
79 //
80 // FOR NEW OBJECT TYPES:
81 // PLEASE USE DEFAULT IMPLEMENTATION ONLY
82 //
83 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
84 
85 switch($target_type)
86 {
87  // exception, must be kept for now
88  case "pg":
89  require_once("./Modules/LearningModule/classes/class.ilLMPageObjectGUI.php");
91  break;
92 
93  // exception, must be kept for now
94  case "st":
95  require_once("./Modules/LearningModule/classes/class.ilStructureObjectGUI.php");
97  break;
98 
99  // exception, must be kept for now
100  case "git":
101  require_once("./Modules/Glossary/classes/class.ilGlossaryTermGUI.php");
102  $target_ref_id = $target_arr[2];
103  ilGlossaryTermGUI::_goto($target_id, $target_ref_id);
104  break;
105 
106  // please migrate to default branch implementation
107  case "glo":
108  require_once("./Modules/Glossary/classes/class.ilObjGlossaryGUI.php");
110  break;
111 
112  // please migrate to default branch implementation
113  case "lm":
114  case "dbk":
115  require_once("./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
117  break;
118 
119  // please migrate to default branch implementation
120  case "htlm":
121  require_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMGUI.php");
123  break;
124 
125  // please migrate to default branch implementation
126  case "exc":
127  require_once("./Modules/Exercise/classes/class.ilObjExerciseGUI.php");
129  break;
130 
131  // please migrate to default branch implementation
132  case "tst":
133  require_once("./Modules/Test/classes/class.ilObjTestGUI.php");
135  break;
136 
137  // please migrate to default branch implementation
138  case "qpl":
139  require_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php");
141  break;
142 
143  // please migrate to default branch implementation
144  case "spl":
145  require_once("./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPoolGUI.php");
147  break;
148 
149  // please migrate to default branch implementation
150  case "svy":
151  require_once("./Modules/Survey/classes/class.ilObjSurveyGUI.php");
152  if (array_key_exists("accesscode", $_GET))
153  {
154  ilObjSurveyGUI::_goto($target_id, $_GET["accesscode"]);
155  }
156  else
157  {
159  }
160  break;
161 
162  // please migrate to default branch implementation
163  case "webr":
164  require_once("./Modules/WebResource/classes/class.ilObjLinkResourceGUI.php");
166  break;
167 
168  // please migrate to default branch implementation
169  case "sahs":
170  require_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleGUI.php");
172  break;
173 
174  // please migrate to default branch implementation
175  case "cat":
176  require_once("./Modules/Category/classes/class.ilObjCategoryGUI.php");
178  break;
179 
180  // please migrate to default branch implementation
181  case "crs":
182  require_once("Modules/Course/classes/class.ilObjCourseGUI.php");
184  break;
185 
186  // please migrate to default branch implementation
187  case "grp":
188  require_once("./Modules/Group/classes/class.ilObjGroupGUI.php");
190  break;
191 
192  // please migrate to default branch implementation
193  case 'fold':
194  require_once("./Modules/Folder/classes/class.ilObjFolderGUI.php");
196  break;
197 
198  // please migrate to default branch implementation
199  case "file":
200  require_once("./Modules/File/classes/class.ilObjFileGUI.php");
202  break;
203 
204  // please migrate to default branch implementation
205  case "mcst":
206  require_once("./Modules/MediaCast/classes/class.ilObjMediaCastGUI.php");
208  break;
209 
210  // please migrate to default branch implementation
211  case 'icrs':
212  require_once 'Modules/ILinc/classes/class.ilObjiLincCourseGUI.php';
214  break;
215 
216  // please migrate to default branch implementation
217  case 'root':
218  require_once('./Modules/RootFolder/classes/class.ilObjRootFolderGUI.php');
220  break;
221 
222  // please migrate to default branch implementation
223  case 'cert':
224  require_once('./Services/Certificate/classes/class.ilCertificate.php');
226  break;
227 
228  //
229  // default implementation (should be used by all new object types)
230  //
231  default:
232  if (!$objDefinition->isPlugin($target_type))
233  {
234  $class_name = "ilObj".$objDefinition->getClassName($target_type)."GUI";
235  $location = $objDefinition->getLocation($target_type);
236  if (is_file($location."/class.".$class_name.".php"))
237  {
238  include_once($location."/class.".$class_name.".php");
239  call_user_func(array($class_name, "_goto"), $rest);
240  }
241  }
242  else
243  {
244  $class_name = "ilObj".$objDefinition->getClassName($target_type)."GUI";
245  $location = $objDefinition->getLocation($target_type);
246  if (is_file($location."/class.".$class_name.".php"))
247  {
248  include_once($location."/class.".$class_name.".php");
249  call_user_func(array($class_name, "_goto"), array($rest, $class_name));
250  }
251  }
252  break;
253 }
254 ?>