Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
IA2
RAP
Commits
e9d62827
Commit
e9d62827
authored
7 years ago
by
Sonia Zorba
Browse files
Options
Downloads
Patches
Plain Diff
Added workaround for IA2 users
parent
dea1fb34
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
classes/Identity.php
+15
-0
15 additions, 0 deletions
classes/Identity.php
classes/MySQLDAO.php
+4
-1
4 additions, 1 deletion
classes/MySQLDAO.php
classes/UserSearchResult.php
+1
-1
1 addition, 1 deletion
classes/UserSearchResult.php
include/user-data.php
+1
-1
1 addition, 1 deletion
include/user-data.php
with
21 additions
and
3 deletions
classes/Identity.php
+
15
−
0
View file @
e9d62827
...
@@ -98,4 +98,19 @@ class Identity {
...
@@ -98,4 +98,19 @@ class Identity {
$this
->
primary
=
false
;
$this
->
primary
=
false
;
}
}
private
static
function
endsWith
(
$haystack
,
$needle
)
{
return
substr
(
$haystack
,
-
strlen
(
$needle
))
===
$needle
;
}
/**
* Workaround for IA2 users
*/
public
function
getUIType
()
{
if
(
$this
->
eppn
!==
null
&&
$this
->
endsWith
(
$this
->
eppn
,
'@ia2.inaf.it'
))
{
return
'IA2'
;
}
else
{
return
$this
->
type
;
}
}
}
}
This diff is collapsed.
Click to expand it.
classes/MySQLDAO.php
+
4
−
1
View file @
e9d62827
...
@@ -208,13 +208,16 @@ class MySQLDAO implements DAO {
...
@@ -208,13 +208,16 @@ class MySQLDAO implements DAO {
.
" i.`id`, `type`, `typed_id`, `email`, `name`, `surname`, `institution`, `eppn`"
.
" i.`id`, `type`, `typed_id`, `email`, `name`, `surname`, `institution`, `eppn`"
.
" FROM identity i"
.
" FROM identity i"
.
" JOIN `user` u on u.id = i.user_id"
.
" JOIN `user` u on u.id = i.user_id"
.
" WHERE `email` LIKE :email OR `name` LIKE :name OR `surname` LIKE :surname"
.
" WHERE `email` LIKE :email OR `email` LIKE :emailPart"
.
" OR `name` LIKE :name OR `surname` LIKE :surname"
.
" OR CONCAT(`name`,' ',`surname`) LIKE :namesurname"
;
.
" OR CONCAT(`name`,' ',`surname`) LIKE :namesurname"
;
$stmt
=
$dbh
->
prepare
(
$query
);
$stmt
=
$dbh
->
prepare
(
$query
);
$searchParam
=
$searchText
.
'%'
;
$searchParam
=
$searchText
.
'%'
;
$emailPartSearchParam
=
'%.'
.
$searchText
.
'%'
;
$stmt
->
bindParam
(
':email'
,
$searchParam
);
$stmt
->
bindParam
(
':email'
,
$searchParam
);
$stmt
->
bindParam
(
':emailPart'
,
$emailPartSearchParam
);
$stmt
->
bindParam
(
':name'
,
$searchParam
);
$stmt
->
bindParam
(
':name'
,
$searchParam
);
$stmt
->
bindParam
(
':surname'
,
$searchParam
);
$stmt
->
bindParam
(
':surname'
,
$searchParam
);
$stmt
->
bindParam
(
':namesurname'
,
$searchParam
);
$stmt
->
bindParam
(
':namesurname'
,
$searchParam
);
...
...
This diff is collapsed.
Click to expand it.
classes/UserSearchResult.php
+
1
−
1
View file @
e9d62827
...
@@ -37,7 +37,7 @@ class UserSearchResult {
...
@@ -37,7 +37,7 @@ class UserSearchResult {
$email
=
null
;
$email
=
null
;
$identityTypes
=
[];
$identityTypes
=
[];
foreach
(
$user
->
identities
as
$identity
)
{
foreach
(
$user
->
identities
as
$identity
)
{
array_push
(
$identityTypes
,
$identity
->
t
ype
);
array_push
(
$identityTypes
,
$identity
->
getUIT
ype
()
);
if
(
$nameAndSurname
===
null
&&
$identity
->
name
!==
null
&&
$identity
->
surname
!==
null
)
{
if
(
$nameAndSurname
===
null
&&
$identity
->
name
!==
null
&&
$identity
->
surname
!==
null
)
{
$nameAndSurname
=
$identity
->
name
.
' '
.
$identity
->
surname
;
$nameAndSurname
=
$identity
->
name
.
' '
.
$identity
->
surname
;
}
}
...
...
This diff is collapsed.
Click to expand it.
include/user-data.php
+
1
−
1
View file @
e9d62827
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<?php
}
?>
<?php
}
?>
Type
Type
</dt>
</dt>
<dd>
<?php
echo
$identity
->
t
ype
;
?>
</dd>
<dd>
<?php
echo
$identity
->
getUIT
ype
()
;
?>
</dd>
<dt>
E-mail
</dt>
<dt>
E-mail
</dt>
<dd>
<?php
echo
$identity
->
email
;
?>
</dd>
<dd>
<?php
echo
$identity
->
email
;
?>
</dd>
<?php
if
(
$identity
->
eppn
!==
null
)
{
?>
<?php
if
(
$identity
->
eppn
!==
null
)
{
?>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment