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

20 {
21 if (isset($attributes['displayName'])) {
22 return $attributes['displayName'][0];
23 }
24
25 if (isset($attributes['cn'])) {
26 if (count(explode(' ', $attributes['cn'][0])) > 1) {
27 return $attributes['cn'][0];
28 }
29 }
30
31 if (isset($attributes['sn']) && isset($attributes['givenName'])) {
32 return $attributes['givenName'][0].' '.$attributes['sn'][0];
33 }
34
35 if (isset($attributes['cn'])) {
36 return $attributes['cn'][0];
37 }
38
39 if (isset($attributes['sn'])) {
40 return $attributes['sn'][0];
41 }
42
43 if (isset($attributes['givenName'])) {
44 return $attributes['givenName'][0];
45 }
46
47 if (isset($attributes['eduPersonPrincipalName'])) {
48 $localname = $this->getLocalUser($attributes['eduPersonPrincipalName'][0]);
49 if (isset($localname)) {
50 return $localname;
51 }
52 }
53
54 return null;
55 }
$attributes
Attributes which should be added/appended.
Definition: SmartName.php:16

References $attributes, and getLocalUser().

Referenced by process().

+ 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 57 of file SmartName.php.

58 {
59 if (strpos($userid, '@') === false) {
60 return null;
61 }
62 $decomposed = explode('@', $userid);
63 if (count($decomposed) === 2) {
64 return $decomposed[0];
65 }
66 return null;
67 }
if(empty($userids)) $userid

References $userid.

Referenced by getFullName().

+ 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

Reimplemented from SimpleSAML_Auth_ProcessingFilter.

Definition at line 76 of file SmartName.php.

77 {
78 assert(is_array($request));
79 assert(array_key_exists('Attributes', $request));
80
81 $attributes =& $request['Attributes'];
82
83 $fullname = $this->getFullName($attributes);
84
85 if (isset($fullname)) {
86 $request['Attributes']['smartname-fullname'] = array($fullname);
87 }
88 }
foreach($paths as $path) $request
Definition: asyncclient.php:32

References $attributes, $request, and getFullName().

+ 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: