Fix default gid 65534 for User in LDAP
posixAccount objectclass (intended to be used with the uid/gid/homedir fields) requires a gid. Always set a gid in LDAP for the User class even if the user does not belong to any group. By default 65534 which corresponds to the nobody group on major distributions (incl. Debian).
This commit is contained in:
parent
b5c88d5817
commit
014b34acc6
@ -2678,10 +2678,10 @@ class User extends CommonObject
|
||||
}
|
||||
|
||||
if (!empty($conf->global->LDAP_FIELD_USERID))$info[$conf->global->LDAP_FIELD_USERID] = $this->id;
|
||||
if (!empty($info[$conf->global->LDAP_FIELD_GROUPID])) {
|
||||
if (!empty($conf->global->LDAP_FIELD_GROUPID)) {
|
||||
$usergroup = new UserGroup($this->db);
|
||||
$groupslist = $usergroup->listGroupsForUser($this->id);
|
||||
$info[$conf->global->LDAP_FIELD_GROUPID] = '1';
|
||||
$info[$conf->global->LDAP_FIELD_GROUPID] = '65534';
|
||||
if (!empty($groupslist)) {
|
||||
foreach ($groupslist as $groupforuser) {
|
||||
$info[$conf->global->LDAP_FIELD_GROUPID] = $groupforuser->id; //Select first group in list
|
||||
|
||||
Loading…
Reference in New Issue
Block a user