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
eee8df45
Commit
eee8df45
authored
Mar 29, 2018
by
Bertrand Gauthier
Browse files
Corrections ldap mapper indisponible
parent
06d9620f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/UnicaenAuth/Authentication/Adapter/Cas.php
View file @
eee8df45
<?php
namespace
UnicaenAuth\Authentication\Adapter
;
use
phpCAS
;
use
UnicaenApp\
Exception
;
use
UnicaenApp\
Mapper\Ldap\People
as
LdapPeopleMapper
;
use
UnicaenAuth\Options\ModuleOptions
;
use
UnicaenAuth\Service\User
;
use
Zend\Authentication\Exception\UnexpectedValueException
;
use
Zend\Authentication\Result
as
AuthenticationResult
;
use
Zend\EventManager\EventManager
;
...
...
@@ -48,6 +50,11 @@ class Cas extends AbstractAdapter implements ServiceManagerAwareInterface, Event
*/
protected
$casClient
;
/**
* @var LdapPeopleMapper
*/
protected
$ldapPeopleMapper
;
/**
* Réalise l'authentification.
*
...
...
@@ -94,7 +101,7 @@ class Cas extends AbstractAdapter implements ServiceManagerAwareInterface, Event
$e
->
setCode
(
AuthenticationResult
::
SUCCESS
)
->
setMessages
([
'Authentication successful.'
]);
// recherche de l'individu dans l'annuaire LDAP
,
il existe forcément puisque l'auth CAS a réussi
.
// recherche de l'individu dans l'annuaire LDAP
(
il existe forcément puisque l'auth CAS a réussi
)
$ldapPeople
=
$this
->
getLdapPeopleMapper
()
->
findOneByUsername
(
$identity
);
/* @var $userService User */
...
...
@@ -193,6 +200,31 @@ class Cas extends AbstractAdapter implements ServiceManagerAwareInterface, Event
return
$this
->
options
;
}
/**
* get ldap people mapper
*
* @return LdapPeopleMapper
*/
public
function
getLdapPeopleMapper
()
{
if
(
null
===
$this
->
ldapPeopleMapper
)
{
$this
->
ldapPeopleMapper
=
$this
->
getServiceManager
()
->
get
(
'ldap_people_mapper'
);
}
return
$this
->
ldapPeopleMapper
;
}
/**
* set ldap people mapper
*
* @param LdapPeopleMapper $mapper
* @return self
*/
public
function
setLdapPeopleMapper
(
LdapPeopleMapper
$mapper
)
{
$this
->
ldapPeopleMapper
=
$mapper
;
return
$this
;
}
/**
* Get service manager
*
...
...
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