}
$ldapname = $ldapname[0];
}
- $intname = $isUser ? $this->sanitizeUsername($uuid) : $ldapname;
+
+ if($isUser) {
+ $usernameAttribute = $this->connection->ldapExpertUsernameAttr;
+ if(!emptY($usernameAttribute)) {
+ $username = $this->readAttribute($dn, $usernameAttribute);
+ $username = $username[0];
+ } else {
+ $username = $uuid;
+ }
+ $intname = $this->sanitizeUsername($username);
+ } else {
+ $intname = $ldapname;
+ }
//a new user/group! Add it only if it doesn't conflict with other backend's users or existing groups
//disabling Cache is required to avoid that the new user is cached as not-existing in fooExists check
return true;
}
+ $fixedAttribute = $this->connection->ldapExpertUUIDAttr;
+ if(!empty($fixedAttribute)) {
+ $this->connection->ldapUuidAttribute = $fixedAttribute;
+ return true;
+ }
+
//for now, supported (known) attributes are entryUUID, nsuniqueid, objectGUID
$testAttributes = array('entryuuid', 'nsuniqueid', 'objectguid', 'guid');