[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:
parent
01a22242d3
commit
7ed701b471
@ -232,8 +232,11 @@ class Ldap_User implements User_Definition {
|
||||
}
|
||||
|
||||
public function display_name() {
|
||||
if (!empty($this->ldap_entry["displayname"][0])) {
|
||||
return $this->ldap_entry["displayname"][0];
|
||||
}
|
||||
return $this->ldap_entry["cn"][0];
|
||||
}
|
||||
|
||||
public function __get($key) {
|
||||
switch($key) {
|
||||
|
Reference in New Issue
Block a user