ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
SmartName.php
Go to the documentation of this file.
1
<?
php
2
9
class
sspmod_smartattributes_Auth_Process_SmartName
extends
SimpleSAML_Auth_ProcessingFilter
10
{
16
private
$attributes
= array();
17
18
19
private
function
getFullName
(
$attributes
)
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
}
56
57
private
function
getLocalUser
(
$userid
)
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
}
68
76
public
function
process
(&
$request
)
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
}
89
}
$request
foreach($paths as $path) $request
Definition:
asyncclient.php:32
$userid
if(empty($userids)) $userid
Definition:
consentAdmin.php:134
sspmod_smartattributes_Auth_Process_SmartName\$attributes
$attributes
Attributes which should be added/appended.
Definition:
SmartName.php:16
sspmod_smartattributes_Auth_Process_SmartName
Definition:
SmartName.php:9
sspmod_smartattributes_Auth_Process_SmartName\getLocalUser
getLocalUser($userid)
Definition:
SmartName.php:57
sspmod_smartattributes_Auth_Process_SmartName\process
process(&$request)
Apply filter to add or replace attributes.
Definition:
SmartName.php:76
php
SimpleSAML_Auth_ProcessingFilter
Definition:
ProcessingFilter.php:21
sspmod_smartattributes_Auth_Process_SmartName\getFullName
getFullName($attributes)
Definition:
SmartName.php:19
libs
composer
vendor
simplesamlphp
simplesamlphp
modules
smartattributes
lib
Auth
Process
SmartName.php
Generated on Thu Jan 16 2025 19:01:56 for ILIAS by
1.8.13 (using
Doxyfile
)