ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
PersistentNameID2TargetedID.php
Go to the documentation of this file.
1 <?php
2 
3 
10 {
11 
17  private $attribute;
18 
19 
25  private $nameId;
26 
27 
34  public function __construct($config, $reserved)
35  {
36  parent::__construct($config, $reserved);
37  assert('is_array($config)');
38 
39  if (isset($config['attribute'])) {
40  $this->attribute = (string) $config['attribute'];
41  } else {
42  $this->attribute = 'eduPersonTargetedID';
43  }
44 
45  if (isset($config['nameId'])) {
46  $this->nameId = (bool) $config['nameId'];
47  } else {
48  $this->nameId = true;
49  }
50  }
51 
52 
58  public function process(&$state)
59  {
60  assert('is_array($state)');
61 
62  if (!isset($state['saml:NameID'][\SAML2\Constants::NAMEID_PERSISTENT])) {
64  'Unable to generate eduPersonTargetedID because no persistent NameID was available.'
65  );
66  return;
67  }
68 
70  $nameID = $state['saml:NameID'][\SAML2\Constants::NAMEID_PERSISTENT];
71 
72  $state['Attributes'][$this->attribute] = array((!$this->nameId) ? $nameID->value : $nameID);
73  }
74 }
Add rich text string
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10
static warning($string)
Definition: Logger.php:179
__construct($config, $reserved)
Initialize this filter, parse configuration.
Create styles array
The data for the language used.
const NAMEID_PERSISTENT
Persistent NameID format.
Definition: Constants.php:190
process(&$request)
Process a request.