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