Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lib
unicaen
auth
Commits
5d7e0bc5
Commit
5d7e0bc5
authored
Feb 14, 2014
by
Bertrand Gauthier
Browse files
Un peu plus générique!
parent
1bfbd62f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/UnicaenAuth/Provider/Identity/Ldap.php
View file @
5d7e0bc5
...
...
@@ -3,6 +3,8 @@ namespace UnicaenAuth\Provider\Identity;
use
UnicaenAuth\Entity\Ldap\People
;
use
BjyAuthorize\Provider\Identity\AuthenticationIdentityProvider
;
use
BjyAuthorize\Provider\Role\ProviderInterface
;
use
ZfcUser\Entity\UserInterface
;
/**
* Classe de fournisseur d'identité issue de l'annuaire Ldap.
...
...
@@ -37,13 +39,19 @@ class Ldap extends AuthenticationIdentityProvider implements ChainableProvider//
$identity
=
$identity
[
'ldap'
];
}
if
(
$identity
instanceof
People
)
{
$roles
=
$identity
->
getRoles
();
$roles
[]
=
$identity
->
getUsername
();
if
(
$identity
instanceof
ProviderInterface
)
{
$roles
=
$identity
->
getRoles
();
if
(
$roles
instanceof
Traversable
)
{
$roles
=
iterator_to_array
(
$roles
);
}
}
else
{
$roles
=
array
();
}
if
(
$identity
instanceof
UserInterface
)
{
$roles
[]
=
$identity
->
getUsername
();
}
if
(
!
$roles
)
{
$roles
=
array
(
$this
->
authenticatedRole
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment