ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
CDC.php
Go to the documentation of this file.
1<?php
2
9{
15 private $domain;
16
17
23 private $client;
24
25
32 public function __construct($config, $reserved)
33 {
34 parent::__construct($config, $reserved);
35 assert(is_array($config));
36
37 if (!isset($config['domain'])) {
38 throw new SimpleSAML_Error_Exception('Missing domain option in cdc:CDC filter.');
39 }
40 $this->domain = (string)$config['domain'];
41
42 $this->client = new sspmod_cdc_Client($this->domain);
43 }
44
45
51 public function process(&$state)
52 {
53 assert(is_array($state));
54
55 if (!isset($state['Source']['entityid'])) {
56 SimpleSAML\Logger::warning('saml:CDC: Could not find IdP entityID.');
57 return;
58 }
59
60 // Save state and build request
62
63 $returnTo = SimpleSAML\Module::getModuleURL('cdc/resume.php', array('domain' => $this->domain));
64
65 $params = array(
66 'id' => $id,
67 'entityID' => $state['Source']['entityid'],
68 );
69 $this->client->sendRequest($returnTo, 'append', $params);
70 }
71}
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10
if(!isset($_REQUEST['ReturnTo'])) $returnTo
Definition: authpage.php:16
An exception for terminatinating execution or to throw for unit testing.
static warning($string)
Definition: Logger.php:177
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.
Definition: Module.php:220
static saveState(&$state, $stage, $rawId=false)
Save the state.
Definition: State.php:194
__construct($config, $reserved)
Initialize this filter.
Definition: CDC.php:32
process(&$state)
Redirect to page setting CDC.
Definition: CDC.php:51
if(!array_key_exists('StateId', $_REQUEST)) $id
$config
Definition: bootstrap.php:15