ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 Member Functions

 setIdentifier ($direction, $state)
 

Private Attributes

 $attribute = null
 
 $typeTag = 'saml20-idp-SSO'
 
 $skipPassive = false
 

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 34 of file StatisticsWithAttribute.php.

References $config.

35  {
36  parent::__construct($config, $reserved);
37 
38  assert(is_array($config));
39 
40  if (array_key_exists('attributename', $config)) {
41  $this->attribute = $config['attributename'];
42  if (!is_string($this->attribute)) {
43  throw new Exception('Invalid attribute name given to core:StatisticsWithAttribute filter.');
44  }
45  }
46 
47  if (array_key_exists('type', $config)) {
48  $this->typeTag = $config['type'];
49  if (!is_string($this->typeTag)) {
50  throw new Exception('Invalid typeTag given to core:StatisticsWithAttribute filter.');
51  }
52  }
53 
54  if (array_key_exists('skipPassive', $config)) {
55  $this->skipPassive = (bool) $config['skipPassive'];
56  }
57  }
$config
Definition: bootstrap.php:15

Member Function Documentation

◆ process()

sspmod_core_Auth_Process_StatisticsWithAttribute::process ( $state)

Log line.

Parameters
array&$stateThe current state.

Definition at line 65 of file StatisticsWithAttribute.php.

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

66  {
67  assert(is_array($state));
68  assert(array_key_exists('Attributes', $state));
69 
70  $logAttribute = 'NA';
71  $isPassive = '';
72 
73  if (array_key_exists('isPassive', $state) && $state['isPassive'] === true) {
74  if ($this->skipPassive === true) {
75  // We have a passive request. Skip logging statistics
76  return;
77  }
78  $isPassive = 'passive-';
79  }
80 
81  if (array_key_exists($this->attribute, $state['Attributes'])) {
82  $logAttribute = $state['Attributes'][$this->attribute][0];
83  }
84 
85  $source = $this->setIdentifier('Source', $state);
86  $dest = $this->setIdentifier('Destination', $state);
87 
88  if (!array_key_exists('PreviousSSOTimestamp', $state)) {
89  // The user hasn't authenticated with this SP earlier in this session
90  SimpleSAML\Logger::stats($isPassive.$this->typeTag.'-first '.$dest.' '.$source.' '. $logAttribute);
91  }
92 
93  SimpleSAML\Logger::stats($isPassive.$this->typeTag.' '.$dest.' '.$source.' '.$logAttribute);
94  }
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10
static stats($string)
Definition: Logger.php:222
$source
Definition: linkback.php:22
+ Here is the call graph for this function:

◆ setIdentifier()

sspmod_core_Auth_Process_StatisticsWithAttribute::setIdentifier (   $direction,
  $state 
)
private
Parameters
string&$directionEither 'Source' or 'Destination'.
array$stateThe current state.
Returns
string

Definition at line 102 of file StatisticsWithAttribute.php.

References $state.

Referenced by process().

103  {
104  if (array_key_exists($direction, $state)) {
105  if (isset($state[$direction]['core:statistics-id'])) {
106  return $state[$direction]['core:statistics-id'];
107  } else {
108  return $state[$direction]['entityid'];
109  }
110  }
111  return 'NA';
112  }
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10
+ Here is the caller graph for this function:

Field Documentation

◆ $attribute

sspmod_core_Auth_Process_StatisticsWithAttribute::$attribute = null
private

Definition at line 15 of file StatisticsWithAttribute.php.

Referenced by process().

◆ $skipPassive

sspmod_core_Auth_Process_StatisticsWithAttribute::$skipPassive = false
private

Definition at line 25 of file StatisticsWithAttribute.php.

◆ $typeTag

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

Definition at line 20 of file StatisticsWithAttribute.php.


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