ILIAS  Release_4_0_x_branch Revision 61816
 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 $target_ref_id = $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");
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 "frm":
127  require_once("./Modules/Forum/classes/class.ilObjForumGUI.php");
128  $target_thread = $target_arr[2];
129  $target_posting = $target_arr[3];
130  ilObjForumGUI::_goto($target_id, $target_thread, $target_posting);
131  break;
132 
133  // please migrate to default branch implementation
134  case "exc":
135  require_once("./Modules/Exercise/classes/class.ilObjExerciseGUI.php");
137  break;
138 
139  // please migrate to default branch implementation
140  case "tst":
141  require_once("./Modules/Test/classes/class.ilObjTestGUI.php");
143  break;
144 
145  // please migrate to default branch implementation
146  case "qpl":
147  require_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php");
149  break;
150 
151  // please migrate to default branch implementation
152  case "spl":
153  require_once("./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPoolGUI.php");
155  break;
156 
157  // please migrate to default branch implementation
158  case "svy":
159  require_once("./Modules/Survey/classes/class.ilObjSurveyGUI.php");
160  if (array_key_exists("accesscode", $_GET))
161  {
162  ilObjSurveyGUI::_goto($target_id, $_GET["accesscode"]);
163  }
164  else
165  {
167  }
168  break;
169 
170  // please migrate to default branch implementation
171  case "webr":
172  require_once("./Modules/WebResource/classes/class.ilObjLinkResourceGUI.php");
174  break;
175 
176  // please migrate to default branch implementation
177  case "chat":
178  require_once("./Modules/Chat/classes/class.ilObjChatGUI.php");
180  break;
181 
182  // please migrate to default branch implementation
183  case "sahs":
184  require_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleGUI.php");
186  break;
187 
188  // please migrate to default branch implementation
189  case "cat":
190  require_once("./Modules/Category/classes/class.ilObjCategoryGUI.php");
192  break;
193 
194  // please migrate to default branch implementation
195  case "crs":
196  require_once("Modules/Course/classes/class.ilObjCourseGUI.php");
198  break;
199 
200  // please migrate to default branch implementation
201  case "grp":
202  require_once("./Modules/Group/classes/class.ilObjGroupGUI.php");
204  break;
205 
206  // please migrate to default branch implementation
207  case 'fold':
208  require_once("./Modules/Folder/classes/class.ilObjFolderGUI.php");
210  break;
211 
212  // please migrate to default branch implementation
213  case "file":
214  require_once("./Modules/File/classes/class.ilObjFileGUI.php");
216  break;
217 
218  // please migrate to default branch implementation
219  case "mcst":
220  require_once("./Modules/MediaCast/classes/class.ilObjMediaCastGUI.php");
222  break;
223 
224  // please migrate to default branch implementation
225  case 'icrs':
226  require_once 'Modules/ILinc/classes/class.ilObjiLincCourseGUI.php';
228  break;
229 
230  // please migrate to default branch implementation
231  case 'root':
232  require_once('./Modules/RootFolder/classes/class.ilObjRootFolderGUI.php');
234  break;
235 
236  // please migrate to default branch implementation
237  case 'cert':
238  require_once('./Services/Certificate/classes/class.ilCertificate.php');
240  break;
241 
242  //
243  // default implementation (should be used by all new object types)
244  //
245  default:
246  if (!$objDefinition->isPlugin($target_type))
247  {
248  $class_name = "ilObj".$objDefinition->getClassName($target_type)."GUI";
249  $location = $objDefinition->getLocation($target_type);
250  if (is_file($location."/class.".$class_name.".php"))
251  {
252  include_once($location."/class.".$class_name.".php");
253  call_user_func(array($class_name, "_goto"), $rest);
254  }
255  }
256  else
257  {
258  $class_name = "ilObj".$objDefinition->getClassName($target_type)."GUI";
259  $location = $objDefinition->getLocation($target_type);
260  if (is_file($location."/class.".$class_name.".php"))
261  {
262  include_once($location."/class.".$class_name.".php");
263  call_user_func(array($class_name, "_goto"), array($rest, $class_name));
264  }
265  }
266  break;
267 }
268 ?>