Skip to content
Snippets Groups Projects
Commit 3d572923 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Ajustement de la méthode de recherche

parent 64f72ade
No related branches found
No related tags found
No related merge requests found
......@@ -31,23 +31,23 @@ class LdapIndividu implements RechercheIndividuResultatInterface
public function getId()
{
return $this->people->getId();
return $this->people['uid'];
}
public function getUsername(string $attribut = "supannAliasLogin")
{
return $this->people->get('supannAliasLogin');
return $this->people[$attribut];
}
public function getDisplayname()
{
$tmp_name = $this->people->get('sn');
$tmp_name = $this->people['displayName'];
if (!is_string($tmp_name)) $tmp_name = implode("-", $this->people->get('sn'));
return $tmp_name . " " . $this->people->get('givenName');
return $tmp_name; //$tmp_name . " " . $this->people->get('givenName');
}
public function getEmail()
{
return $this->people->get('mail');
return $this->people['mail'];
}
}
\ No newline at end of file
......@@ -22,13 +22,17 @@ class LdapService implements RechercheIndividuServiceInterface
*/
public function findById($id)
{
$filter = PeopleFilter::uid($id);
/**
* @var PeopleEntity $people
*/
$people = $this->ldapPeopleService->get($id);
/** TODO retirer ce contournement une fois le problème compris */
// $people = $this->ldapPeopleService->get($id);
$people = $this->ldapPeopleService->searchAttributes($filter, ['id', 'uid', 'supannaliaslogin', 'supannAliasLogin','displayName', 'mail']);
$peep = $people[$id];
$p = new LdapIndividu();
$p->setPeople($people);
$p->setPeople($peep);
return $p;
}
......@@ -45,7 +49,8 @@ class LdapService implements RechercheIndividuServiceInterface
);
/** @var PeopleService $ldapService */
try {
$people = $this->ldapPeopleService->search($filter);
$people = $this->ldapPeopleService->searchAttributes($filter, ['id', 'uid', 'supannaliaslogin', 'supannAliasLogin','displayName', 'mail']);
// $people = $this->ldapPeopleService->search($filter);
} catch (Exception $e) {
throw new RuntimeException("Un exception ldap est survenue :", $e);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment