ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
AttributeRealm.php
Go to the documentation of this file.
1 <?php
2 
12 
13  private $attributename = 'realm';
14 
21  public function __construct($config, $reserved) {
22  parent::__construct($config, $reserved);
23  assert('is_array($config)');
24 
25  if (array_key_exists('attributename', $config))
26  $this->attributename = $config['attributename'];
27 
28  }
29 
37  public function process(&$request) {
38  assert('is_array($request)');
39  assert('array_key_exists("Attributes", $request)');
40 
41  $attributes =& $request['Attributes'];
42 
43  if (!array_key_exists('UserID', $request)) {
44  throw new Exception('core:AttributeRealm: Missing UserID for this user. Please' .
45  ' check the \'userid.attribute\' option in the metadata against the' .
46  ' attributes provided by the authentication source.');
47  }
48  $userID = $request['UserID'];
49  $decomposed = explode('@', $userID);
50  if (count($decomposed) !== 2) return;
51  $request['Attributes'][$this->attributename] = array($decomposed[1]);
52  }
53 }
$attributes
process(&$request)
Apply filter to add or replace attributes.
Create styles array
The data for the language used.
__construct($config, $reserved)
Initialize this filter.