ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
postredirect.php
Go to the documentation of this file.
1
<?
php
2
9
if
(array_key_exists(
'RedirId'
, $_REQUEST)) {
10
$postId = $_REQUEST[
'RedirId'
];
11
$session
=
SimpleSAML_Session::getSessionFromRequest
();
12
} elseif (array_key_exists(
'RedirInfo'
, $_REQUEST)) {
13
$encData = base64_decode($_REQUEST[
'RedirInfo'
]);
14
15
if
(empty($encData)) {
16
throw
new
SimpleSAML_Error_BadRequest
(
'Invalid RedirInfo data.'
);
17
}
18
19
list($sessionId, $postId) = explode(
':'
,
SimpleSAML
\Utils\Crypto::aesDecrypt($encData));
20
21
if
(empty($sessionId) || empty($postId)) {
22
throw
new
SimpleSAML_Error_BadRequest
(
'Invalid session info data.'
);
23
}
24
25
$session
=
SimpleSAML_Session::getSession
($sessionId);
26
}
else
{
27
throw
new
SimpleSAML_Error_BadRequest
(
'Missing redirection info parameter.'
);
28
}
29
30
if
(
$session
=== NULL) {
31
throw
new
Exception
(
'Unable to load session.'
);
32
}
33
34
$postData
=
$session
->getData(
'core_postdatalink'
, $postId);
35
36
if
(
$postData
=== NULL) {
37
// The post data is missing, probably because it timed out
38
throw
new
Exception
(
'The POST data we should restore was lost.'
);
39
}
40
41
$session
->deleteData(
'core_postdatalink'
, $postId);
42
43
assert(is_array(
$postData
));
44
assert(array_key_exists(
'url'
,
$postData
));
45
assert(array_key_exists(
'post'
,
$postData
));
46
47
$config
=
SimpleSAML_Configuration::getInstance
();
48
$template
=
new
SimpleSAML_XHTML_Template
(
$config
,
'post.php'
);
49
$template
->data[
'destination'
] =
$postData
[
'url'
];
50
$template
->data[
'post'
] =
$postData
[
'post'
];
51
$template
->show();
52
exit
(0);
$session
$session
Definition:
proxy_ylocal.php:32
SimpleSAML_Session\getSession
static getSession($sessionId=null)
Get a session from the session handler.
Definition:
Session.php:315
$config
$config
Definition:
postredirect.php:47
SimpleSAML
Attribute-related utility methods.
SimpleSAML_Error_BadRequest
Definition:
BadRequest.php:12
$postData
if($session===NULL) $postData
Definition:
postredirect.php:34
exit
exit
Definition:
backend.php:16
SimpleSAML_XHTML_Template
Definition:
Template.php:14
$template
$template
Definition:
postredirect.php:48
php
SimpleSAML_Session\getSessionFromRequest
static getSessionFromRequest()
Retrieves the current session.
Definition:
Session.php:241
SimpleSAML_Configuration\getInstance
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
Definition:
Configuration.php:325
Exception
libs
composer
vendor
simplesamlphp
simplesamlphp
modules
core
www
postredirect.php
Generated on Thu Jan 16 2025 19:01:56 for ILIAS by
1.8.13 (using
Doxyfile
)