Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lib
unicaen
auth
Commits
3548a071
Commit
3548a071
authored
Sep 13, 2013
by
Bertrand Gauthier
Browse files
Renommages pour clarté.
parent
1e6aaa2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/UnicaenAuth/Provider/Identity/LdapPeople.php
View file @
3548a071
...
...
@@ -32,7 +32,7 @@ class LdapPeople implements ProviderInterface, ServiceLocatorAwareInterface
/**
* @var AuthenticationService
*/
protected
$authService
;
protected
$auth
entication
Service
;
/**
* @var string|RoleInterface
...
...
@@ -40,11 +40,11 @@ class LdapPeople implements ProviderInterface, ServiceLocatorAwareInterface
protected
$defaultRole
;
/**
* @param AuthenticationService $authService
* @param AuthenticationService $auth
entication
Service
*/
public
function
__construct
(
AuthenticationService
$authService
)
public
function
__construct
(
AuthenticationService
$auth
entication
Service
)
{
$this
->
authService
=
$authService
;
$this
->
auth
entication
Service
=
$auth
entication
Service
;
}
/**
...
...
@@ -56,16 +56,16 @@ class LdapPeople implements ProviderInterface, ServiceLocatorAwareInterface
{
$roles
=
array
();
$identity
=
$this
->
authService
->
getIdentity
();
$identity
=
$this
->
auth
entication
Service
->
getIdentity
();
if
(
$identity
instanceof
LdapPeopleEntity
)
{
/* @var $identity LdapPeopleEntity */
$a
uthorize
Service
=
$this
->
getServiceLocator
()
->
get
(
'BjyAuthorize\Service\Authorize'
);
/* @var $a
uthorize
Service \BjyAuthorize\Service\Authorize */
$a
cl
Service
=
$this
->
getServiceLocator
()
->
get
(
'BjyAuthorize\Service\Authorize'
);
/* @var $a
cl
Service \BjyAuthorize\Service\Authorize */
foreach
(
$identity
->
getMemberOf
()
as
$group
)
{
// vérifie si le groupe LDAP est un rôle connu des ACL
try
{
$role
=
$a
uthorize
Service
->
getAcl
()
->
getRole
(
$group
);
$role
=
$a
cl
Service
->
getAcl
()
->
getRole
(
$group
);
}
catch
(
InvalidArgumentException
$exc
)
{
continue
;
...
...
@@ -106,7 +106,7 @@ class LdapPeople implements ProviderInterface, ServiceLocatorAwareInterface
public
function
setDefaultRole
(
$defaultRole
)
{
if
(
!
(
$defaultRole
instanceof
RoleInterface
||
is_string
(
$defaultRole
)))
{
throw
new
Exception
(
"Rôle pr défaut fourni invalide."
,
null
,
InvalidRoleException
::
invalidRoleInstance
(
$defaultRole
));
throw
new
Exception
(
"Rôle p
a
r défaut fourni invalide."
,
null
,
InvalidRoleException
::
invalidRoleInstance
(
$defaultRole
));
}
$this
->
defaultRole
=
$defaultRole
;
}
...
...
@@ -132,4 +132,4 @@ class LdapPeople implements ProviderInterface, ServiceLocatorAwareInterface
{
return
$this
->
serviceLocator
;
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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