ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
postredirect.php
Go to the documentation of this file.
1<?php
2
9if (array_key_exists('RedirId', $_REQUEST)) {
10 $postId = $_REQUEST['RedirId'];
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
26} else {
27 throw new SimpleSAML_Error_BadRequest('Missing redirection info parameter.');
28}
29
30if ($session === NULL) {
31 throw new Exception('Unable to load session.');
32}
33
34$postData = $session->getData('core_postdatalink', $postId);
35
36if ($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
43assert(is_array($postData));
44assert(array_key_exists('url', $postData));
45assert(array_key_exists('post', $postData));
46
49$template->data['destination'] = $postData['url'];
50$template->data['post'] = $postData['post'];
51$template->show();
52exit(0);
exit
Definition: backend.php:16
An exception for terminatinating execution or to throw for unit testing.
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
static getSession($sessionId=null)
Get a session from the session handler.
Definition: Session.php:315
static getSessionFromRequest()
Retrieves the current session.
Definition: Session.php:241
Attribute-related utility methods.
$config
if($session===NULL) $postData
$template
$session