No announcement yet.

Fix for User/ with aliases

  • Filter
  • Time
  • Show
Clear All
new posts

  • Fix for User/ with aliases


    if you have aliases in your LDAP databases it may happen that a user has only one alias (not multiple). In this case the OXLDAPsync will fail.

    Here is a patch for, around line 95

    PHP Code:
     if ($self->{_mapping}->{'aliases'})
    my $aliases $self->{_entry}->get_value($self->{_mapping}->{aliases}, asref => 1)
                            if (
    ref($aliaseseq 'ARRAY'){
    $aliasstr join(',',@$aliases);
                            } else {                                
    $aliasstr $aliases;

    Best regards, Eike

  • #2
    Thank you for your investigation!

    Could you please make a unified diff and post it here?


    • #3
      ---   2010-06-17 17:32:28.000000000 +0200
      +++        2010-06-17 15:23:21.000000000 +0200
      @@ -95,7 +95,11 @@
                  if ($self->{_mapping}->{'aliases'})
                              my $aliases = $self->{_entry}->get_value($self->{_mapping}->{aliases}, asref => 1);
      -                       $aliasstr = join(',',@$aliases);
      +                       if (ref($aliases) eq 'ARRAY'){
      +                               $aliasstr = join(',',@$aliases);
      +                       } else {
      +                               $aliasstr = $aliases;
      +                       }
                  if ($aliasstr)


      • #4
        I just tried to reproduce your problem description, but I was not able to do so. Even without your patch, I can have users with one or multiple aliases.

        Could you please describe what happens on your system without your patch?


        • #5
          Have a look at the old OX5 LDAP database structure. There the mail aliases are attributes of the user object. Always at least one entry:

          mail :
          alias :

          If you have multiple mail aliases it like

          mail :
          alias :
          alias :
          alias :

          If I set "aliases = alias" in mappins.conf everything is fine for multiple aliases, because search returns an array. If I have only one alias entry (what is usual the case) the search does not return an array, but a string.

          The patch fixes this.

          best regards, Eike

          btw. Mrs. Betz wrote me you would contact me regarding roxy... (uhh sorry, not you Mr. Herkens).
          Last edited by ehoffman; 06-18-2010, 12:01 PM.