Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • fusiondirectory-plugins fusiondirectory-plugins
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 50
    • Issues 50
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • fusiondirectoryfusiondirectory
  • fusiondirectory-pluginsfusiondirectory-plugins
  • Issues
  • #6081
Closed
Open
Issue created Nov 24, 2020 by Danjean Vincent@vdanjeanReporter

Do not record empty memberUid within mixedgroups

Description

I'm using fusiondirectory 1.3 through Debian package (locally recompiled for buster). I'm using the mixedgroups plugin.

When I create a mixedgroup with one user and several (sub-)groups, I got an error about duplicate (empty) memberUid. Indeed, this is due to the fact that the plugin gets a 'uid' attribute for all its entries, even for (sub-)groups that do not have 'uid' attribute.

I fixed this locally with this patch: In ogroups/mixedgroups/class_mixedGroup.inc, in prepare_save(), I replace:

    foreach ($members as $dn) {
      $ldap->cat($dn, array('uid'));
      $attrs = $ldap->fetch();
      $memberUid[] = $attrs['uid'][0];
    }

by

    foreach ($members as $dn) {
      $ldap->cat($dn, array('uid'));
      $attrs = $ldap->fetch();
      /* Some members (other groups) do not have uid
       * Adding a empty uid is not a problem, but adding two or more is */
      if ($attrs['uid'][0] != '') {
        $memberUid[] = $attrs['uid'][0];
      }
    }

Note: it solve my problem but you might want to do other things, for example:

  • allows empty uid but skip entries with no uid attribute (my patch does the same thing for both cases)

  • check that there are no duplicate uid (empty or not). If there are:

    • return an error
    • cleanup the list to keep only unique values
    • or ...

    Regards Vincent

PS: the code in gitlab seems to be the same in the 1.4 branch, so this bug does not seem already fixed.

Edited Nov 26, 2020 by Danjean Vincent
Assignee
Assign to
Time tracking