Skip to content
Snippets Groups Projects
Commit ce03555a authored by Eduardo Alvarez Fernandez's avatar Eduardo Alvarez Fernandez
Browse files

Gix get email address to return address as string and not as array

parent 0570afff
No related branches found
No related tags found
No related merge requests found
...@@ -71,8 +71,7 @@ Class CERNLdapService { ...@@ -71,8 +71,7 @@ Class CERNLdapService {
protected function getEmailAddress($entry) { protected function getEmailAddress($entry) {
$result = ldap_search($this->conn, $entry, "CN=*", array('mail'), NULL, 0); $result = ldap_search($this->conn, $entry, "CN=*", array('mail'), NULL, 0);
$entries = $this->cleanUpEntry(ldap_get_entries($this->conn, $result)); $entries = $this->cleanUpEntry(ldap_get_entries($this->conn, $result));
dpm($entries, "Entries"); return (array_key_exists('mail', $entries[0])) ? $entries[0]['mail'][0] : "";
return (array_key_exists('mail', $entries[0])) ? $entries[0]['mail'] : "";
} }
...@@ -117,4 +116,4 @@ Class CERNLdapService { ...@@ -117,4 +116,4 @@ Class CERNLdapService {
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment