Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
fusiondirectory-plugins
fusiondirectory-plugins
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 46
    • Issues 46
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • fusiondirectory
  • fusiondirectory-pluginsfusiondirectory-plugins
  • Issues
  • #6081

Closed
Open
Opened 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
FusionDirectory 1.4
Milestone
FusionDirectory 1.4
Assign milestone
Time tracking
None
Due date
None
Reference: fusiondirectory/fd-plugins#6081