ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
studip_referrer.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
11 /* ILIAS Version 4.0.2 */
12 
13 if(file_exists("./ilias.ini.php")){
14  require_once("classes/class.ilIniFile.php");
15  $ilIliasIniFile = new ilIniFile("./ilias.ini.php");
16  $ilIliasIniFile->read();
17  $serverSettings = $ilIliasIniFile->readGroup("server");
18  if ($serverSettings["studip"] != 1)
19  {
20  echo 'Option "studip" in ilias.ini.php is not enabled. You need to add studip = "1" to the server section.';
21  exit();
22  }
23 
24  if (isset($_GET['sess_id']))
25  {
26  setcookie('PHPSESSID',$_GET['sess_id']);
27  $_COOKIE['PHPSESSID'] = $_GET['sess_id'];
28  }
29 
30  if (isset($_GET['client_id']))
31  {
32  setcookie('ilClientId',$_GET['client_id']);
33  $_COOKIE['ilClientId'] = $_GET['client_id'];
34  }
35 
36  require_once "./include/inc.header.php";
37 
38  $jump_to = 'index.php';
39 
40  // redirect to specified page
41  $redirect = false;
42  switch($_GET['target'])
43  {
44  case 'start':
45  switch($_GET['type'])
46  {
47  case 'lm':
48  $_GET['baseClass'] = 'ilLMPresentationGUI';
49  $jump_to = 'ilias.php';
50  break;
51  case 'tst':
52  $_GET['cmd'] = 'infoScreen';
53  $_GET['baseClass'] = 'ilObjTestGUI';
54  $jump_to = 'ilias.php';
55  break;
56  case 'sahs':
57  $jump_to = 'ilias.php?baseClass=ilSAHSPresentationGUI&ref_id='.$_GET['ref_id'];
58  $redirect = true;
59  break;
60  case 'htlm':
61  $_GET['baseClass'] = 'ilHTLMPresentationGUI';
62  $jump_to = 'ilias.php';
63  break;
64  case 'glo':
65  $_GET['baseClass'] = 'ilGlossaryPresentationGUI';
66  $jump_to = 'ilias.php';
67  break;
68  default:
69  unset($jump_to);
70  }
71  break;
72  case 'new':
73  $_POST['new_type'] = $_GET['type'];
74  $_POST['cmd']['create'] = 'add';
75  $_GET['cmd'] = 'post';
76  $_GET[ilCtrl::IL_RTOKEN_NAME] = $ilCtrl->getRequestToken();
77  $jump_to = 'repository.php';
78  break;
79  case 'edit':
80  switch($_GET['type'])
81  {
82  case 'lm':
83  $_GET['baseClass'] = 'ilLMEditorGUI';
84  $jump_to = 'ilias.php';
85  break;
86  case 'tst':
87  $_GET['cmd'] = '';
88  $_GET['baseClass'] = 'ilObjTestGUI';
89  $jump_to = 'ilias.php';
90  break;
91  case 'sahs':
92  $_GET['baseClass'] = 'ilSAHSEditGUI';
93  $jump_to = 'ilias.php';
94  break;
95  case 'htlm':
96  $_GET['baseClass'] = 'ilHTLMEditorGUI';
97  $jump_to = 'ilias.php';
98  break;
99  case 'glo':
100  $_GET['baseClass'] = 'ilGlossaryEditorGUI';
101  $jump_to = 'ilias.php';
102  break;
103  default:
104  unset($jump_to);
105  }
106  break;
107  case 'login':
108  break;
109  default:
110  unset($jump_to);
111  }
112  if ($redirect)
113  {
114  header("Location: ".$jump_to);
115  exit();
116  }
117  elseif(isset($jump_to))
118  {
119  include($jump_to);
120  }
121 }
122 ?>