1
0

[ldap] Use cn when displayName is empty

When the optional 'displayName' attribute is empty, use 'cn', which is
mandatory and never empty. This prevents empty names being displayed.
This commit is contained in:
Michał Sawicz 2011-01-04 00:14:13 +01:00
parent 01a22242d3
commit 7ed701b471

View File

@ -232,7 +232,10 @@ class Ldap_User implements User_Definition {
}
public function display_name() {
return $this->ldap_entry["displayname"][0];
if (!empty($this->ldap_entry["displayname"][0])) {
return $this->ldap_entry["displayname"][0];
}
return $this->ldap_entry["cn"][0];
}
public function __get($key) {