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

Public Member Functions

 process (&$request)
 Apply filter to add or replace 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 Member Functions

 getFullName ($attributes)
 
 getLocalUser ($userid)
 

Private Attributes

 $attributes = array()
 Attributes which should be added/appended. More...
 

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 SmartName.php.

Member Function Documentation

◆ getFullName()

sspmod_smartattributes_Auth_Process_SmartName::getFullName (   $attributes)
private

Definition at line 19 of file SmartName.php.

References $attributes, and getLocalUser().

Referenced by process().

19  {
20  if (isset($attributes['displayName']))
21  return $attributes['displayName'][0];
22 
23  if (isset($attributes['cn'])) {
24  if (count(explode(' ', $attributes['cn'][0])) > 1)
25  return $attributes['cn'][0];
26  }
27 
28  if (isset($attributes['sn']) && isset($attributes['givenName']))
29  return $attributes['givenName'][0] . ' ' . $attributes['sn'][0];
30 
31  if (isset($attributes['cn']))
32  return $attributes['cn'][0];
33 
34  if (isset($attributes['sn']))
35  return $attributes['sn'][0];
36 
37  if (isset($attributes['givenName']))
38  return $attributes['givenName'][0];
39 
40  if (isset($attributes['eduPersonPrincipalName'])) {
41  $localname = $this->getLocalUser($attributes['eduPersonPrincipalName'][0]);
42  if (isset($localname)) return $localname;
43  }
44 
45  return NULL;
46  }
$attributes
Attributes which should be added/appended.
Definition: SmartName.php:16
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLocalUser()

sspmod_smartattributes_Auth_Process_SmartName::getLocalUser (   $userid)
private

Definition at line 48 of file SmartName.php.

References $userid.

Referenced by getFullName().

48  {
49  if (strpos($userid, '@') === FALSE) return NULL;
50  $decomposed = explode('@', $userid);
51  if(count($decomposed) === 2) {
52  return $decomposed[0];
53  }
54  return NULL;
55  }
if(empty($userids)) $userid
+ Here is the caller graph for this function:

◆ process()

sspmod_smartattributes_Auth_Process_SmartName::process ( $request)

Apply filter to add or replace attributes.

Add or replace existing attributes with the configured values.

Parameters
array&$requestThe current request

Definition at line 64 of file SmartName.php.

References $attributes, array, and getFullName().

64  {
65  assert('is_array($request)');
66  assert('array_key_exists("Attributes", $request)');
67 
68  $attributes =& $request['Attributes'];
69 
70  $fullname = $this->getFullName($attributes);
71 
72  if(isset($fullname)) $request['Attributes']['smartname-fullname'] = array($fullname);
73 
74  }
$attributes
Attributes which should be added/appended.
Definition: SmartName.php:16
Create styles array
The data for the language used.
+ Here is the call graph for this function:

Field Documentation

◆ $attributes

sspmod_smartattributes_Auth_Process_SmartName::$attributes = array()
private

Attributes which should be added/appended.

Assiciative array of arrays.

Definition at line 16 of file SmartName.php.

Referenced by getFullName(), and process().


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