ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
sspmod_core_Auth_Process_StatisticsWithAttribute Class Reference
+ Inheritance diagram for sspmod_core_Auth_Process_StatisticsWithAttribute:
+ Collaboration diagram for sspmod_core_Auth_Process_StatisticsWithAttribute:

Public Member Functions

 __construct ($config, $reserved)
 Initialize this filter. More...
 
 process (&$state)
 Log line. 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

 $attribute = NULL
 The attribute to log. More...
 
 $typeTag = 'saml20-idp-SSO'
 

Additional Inherited Members

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

Detailed Description

Definition at line 9 of file StatisticsWithAttribute.php.

Constructor & Destructor Documentation

◆ __construct()

sspmod_core_Auth_Process_StatisticsWithAttribute::__construct (   $config,
  $reserved 
)

Initialize this filter.

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

Definition at line 26 of file StatisticsWithAttribute.php.

References $config.

26  {
27  parent::__construct($config, $reserved);
28 
29  assert('is_array($config)');
30 
31  if (array_key_exists('attributename', $config)) {
32  $this->attribute = $config['attributename'];
33  if (!is_string($this->attribute)) {
34  throw new Exception('Invalid attribute name given to core:StatisticsWithAttribute filter.');
35  }
36  }
37 
38  if (array_key_exists('type', $config)) {
39  $this->typeTag = $config['type'];
40  if (!is_string($this->typeTag)) {
41  throw new Exception('Invalid typeTag given to core:StatisticsWithAttribute filter.');
42  }
43  }
44  }

Member Function Documentation

◆ process()

sspmod_core_Auth_Process_StatisticsWithAttribute::process ( $state)

Log line.

Parameters
array&$stateThe current state.

Definition at line 52 of file StatisticsWithAttribute.php.

References $attribute, $source, $state, and SimpleSAML\Logger\stats().

52  {
53  assert('is_array($state)');
54  assert('array_key_exists("Attributes", $state)');
55 
56  $logAttribute = 'NA';
57  $source = 'NA';
58  $dest = 'NA';
59 
60  if (array_key_exists($this->attribute, $state['Attributes'])) $logAttribute = $state['Attributes'][$this->attribute][0];
61  if (array_key_exists('Source', $state)) {
62  if (isset($state['Source']['core:statistics-id'])) {
63  $source = $state['Source']['core:statistics-id'];
64  } else {
65  $source = $state['Source']['entityid'];
66  }
67  }
68 
69  if (array_key_exists('Destination', $state)) {
70  if (isset($state['Destination']['core:statistics-id'])) {
71  $dest = $state['Destination']['core:statistics-id'];
72  } else {
73  $dest = $state['Destination']['entityid'];
74  }
75  }
76 
77  if (!array_key_exists('PreviousSSOTimestamp', $state)) {
78  // The user hasn't authenticated with this SP earlier in this session
79  SimpleSAML\Logger::stats($this->typeTag . '-first ' . $dest . ' ' . $source . ' ' . $logAttribute);
80  }
81 
82  SimpleSAML\Logger::stats($this->typeTag . ' ' . $dest . ' ' . $source . ' ' . $logAttribute);
83  }
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10
static stats($string)
Definition: Logger.php:224
$source
Definition: linkback.php:22
+ Here is the call graph for this function:

Field Documentation

◆ $attribute

sspmod_core_Auth_Process_StatisticsWithAttribute::$attribute = NULL
private

The attribute to log.

Definition at line 15 of file StatisticsWithAttribute.php.

Referenced by process().

◆ $typeTag

sspmod_core_Auth_Process_StatisticsWithAttribute::$typeTag = 'saml20-idp-SSO'
private

Definition at line 17 of file StatisticsWithAttribute.php.


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