LDAP: check whether user exists for before trying to determine displayname

This commit is contained in:
Arthur Schiwon 2013-03-19 11:16:57 +01:00
parent 18fccf6612
commit 50d0f48ee4
1 changed files with 4 additions and 0 deletions

View File

@ -217,6 +217,10 @@ class USER_LDAP extends lib\Access implements \OCP\UserInterface {
* @return display name
*/
public function getDisplayName($uid) {
if(!$this->userExists($uid)) {
return false;
}
$cacheKey = 'getDisplayName'.$uid;
if(!is_null($displayName = $this->connection->getFromCache($cacheKey))) {
return $displayName;