Homepage | Products | OX Knowledge Base | Support | Try Now | Contact | Company
OX Logo
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2008
    Posts
    12

    Default Fix for User/Decorator.pm with aliases

    Hi,

    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 Decorator.pm, 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. #2
    Carsten Hoeger is offline Open-Xchange Professional Services
    Join Date
    Mar 2007
    Posts
    703

    Default

    Thank you for your investigation!

    Could you please make a unified diff and post it here?
    OXpedia.org - the answer to almost all questions.

  3. #3
    Join Date
    Feb 2008
    Posts
    12

    Default

    Code:
    --- Decorator.orig.pm   2010-06-17 17:32:28.000000000 +0200
    +++ Decorator.pm        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. #4
    Carsten Hoeger is offline Open-Xchange Professional Services
    Join Date
    Mar 2007
    Posts
    703

    Default

    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?
    OXpedia.org - the answer to almost all questions.

  5. #5
    Join Date
    Feb 2008
    Posts
    12

    Default

    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 : me@mail.com
    alias : me@mail.com

    If you have multiple mail aliases it like

    mail : me@mail.com
    alias : me@mail.com
    alias : alias1@mail.com
    alias : alias2@mail.com

    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 at 12:01 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •