ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
postredirect.php
Go to the documentation of this file.
1 <?php
2 
9 if (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 
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 
49 $template->data['destination'] = $postData['url'];
50 $template->data['post'] = $postData['post'];
51 $template->show();
52 exit(0);
$session
static getSession($sessionId=null)
Get a session from the session handler.
Definition: Session.php:317
$config
Attribute-related utility methods.
if($session===NULL) $postData
$template
static getSessionFromRequest()
Retrieves the current session.
Definition: Session.php:243
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.