ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
sspmod_core_Auth_Process_AttributeCopy Class Reference
+ Inheritance diagram for sspmod_core_Auth_Process_AttributeCopy:
+ Collaboration diagram for sspmod_core_Auth_Process_AttributeCopy:

Public Member Functions

 __construct ($config, $reserved)
 Initialize this filter, parse configuration. More...
 
 process (&$request)
 Apply filter to rename attributes. More...
 
- Public Member Functions inherited from SimpleSAML_Auth_ProcessingFilter
 __construct (&$config, $reserved)
 Constructor for a processing filter. More...
 
 process (&$request)
 Process a request. More...
 

Private Attributes

 $map = array()
 Assosiative array with the mappings of attribute names. More...
 

Additional Inherited Members

- Data Fields inherited from SimpleSAML_Auth_ProcessingFilter
 $priority = 50
 Priority of this filter. More...
 

Detailed Description

Definition at line 18 of file AttributeCopy.php.

Constructor & Destructor Documentation

◆ __construct()

sspmod_core_Auth_Process_AttributeCopy::__construct (   $config,
  $reserved 
)

Initialize this filter, parse configuration.

Parameters
array$configConfiguration information about this filter.
mixed$reservedFor future use.

Definition at line 32 of file AttributeCopy.php.

References $config, $destination, and $source.

32  {
33  parent::__construct($config, $reserved);
34 
35  assert(is_array($config));
36 
37  foreach($config as $source => $destination) {
38 
39  if(!is_string($source)) {
40  throw new Exception('Invalid source attribute name: ' . var_export($source, TRUE));
41  }
42 
43  if(!is_string($destination) && !is_array($destination)) {
44  throw new Exception('Invalid destination attribute name: ' . var_export($destination, TRUE));
45  }
46 
47  $this->map[$source] = $destination;
48  }
49  }
$config
Definition: bootstrap.php:15
$destination
$source
Definition: linkback.php:22

Member Function Documentation

◆ process()

sspmod_core_Auth_Process_AttributeCopy::process ( $request)

Apply filter to rename attributes.

Parameters
array&$requestThe current request

Definition at line 57 of file AttributeCopy.php.

References $attributes, $name, $request, and $values.

57  {
58  assert(is_array($request));
59  assert(array_key_exists('Attributes', $request));
60 
61  $attributes =& $request['Attributes'];
62 
63  foreach($attributes as $name => $values) {
64  if (array_key_exists($name,$this->map)){
65  if (!is_array($this->map[$name])) {
66  $attributes[$this->map[$name]] = $values;
67  } else {
68  foreach ($this->map[$name] as $to_map) {
69  $attributes[$to_map] = $values;
70  }
71  }
72  }
73  }
74 
75  }
foreach($paths as $path) $request
Definition: asyncclient.php:32
$values
if(array_key_exists('yes', $_REQUEST)) $attributes
Definition: getconsent.php:85

Field Documentation

◆ $map

sspmod_core_Auth_Process_AttributeCopy::$map = array()
private

Assosiative array with the mappings of attribute names.

Definition at line 23 of file AttributeCopy.php.


The documentation for this class was generated from the following file: