Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp-module-perun
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp-module-perun
Merge requests
!313
feat:
RPC method - find user by email
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
feat:
RPC method - find user by email
find_user_by_email
into
main
Overview
1
Commits
1
Pipelines
4
Changes
1
Merged
feat: 🎸 RPC method - find user by email
Ghost User
requested to merge
find_user_by_email
into
main
Sep 1, 2023
Overview
1
Commits
1
Pipelines
4
Changes
1
0
0
Merge request reports
Compare
main
version 2
2e071caf
Sep 1, 2023
version 1
c5e4969c
Sep 1, 2023
main (base)
and
latest version
latest version
5095ca4a
1 commit,
Sep 1, 2023
version 2
2e071caf
1 commit,
Sep 1, 2023
version 1
c5e4969c
1 commit,
Sep 1, 2023
1 file
+
35
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
lib/AdapterRpc.php
+
35
−
0
View file @ 5095ca4a
Edit in single-file editor
Open in Web IDE
Show full file
@@ -119,6 +119,41 @@ class AdapterRpc extends Adapter
return
$this
->
getPerunUser
(
$idpEntityId
,
$uids
);
}
public
function
getPerunUserByEmail
(
$emailAttrUrn
,
$emailValue
)
{
$user
=
null
;
$users
=
$this
->
connector
->
get
(
'usersManager'
,
'getUsersByAttributeValue'
,
[
'attributeName'
=>
$emailAttrUrn
,
'attributeValue'
=>
$emailValue
,
]);
if
(
count
(
$users
)
>
1
)
{
throw
new
Exception
(
'Multiple users with email '
.
$emailValue
.
' found'
);
}
elseif
(
count
(
$users
)
===
0
)
{
throw
new
Exception
(
'No users with email '
.
$emailValue
.
' found'
);
}
else
{
$user
=
$users
[
0
];
$name
=
''
;
if
(
!
empty
(
$user
[
'titleBefore'
]))
{
$name
.
=
$user
[
'titleBefore'
]
.
' '
;
}
if
(
!
empty
(
$user
[
'firstName'
]))
{
$name
.
=
$user
[
'firstName'
]
.
' '
;
}
if
(
!
empty
(
$user
[
'middleName'
]))
{
$name
.
=
$user
[
'middleName'
]
.
' '
;
}
if
(
!
empty
(
$user
[
'lastName'
]))
{
$name
.
=
$user
[
'lastName'
];
}
if
(
!
empty
(
$user
[
'titleAfter'
]))
{
$name
.
=
' '
.
$user
[
'titleAfter'
];
}
return
new
User
(
$user
[
'id'
],
$name
);
}
}
public
function
getMemberGroups
(
$user
,
$vo
)
{
try
{
Loading