Oops. ok, not string, SCALAR.

On Sun, Feb 24, 2013 at 11:12 AM, Gerald Young <[email protected]> wrote:

> for ldap returning different values for the same attribute? out of the
> box, no.
> Ldap->search returns a string.
> http://search.cpan.org/~marschap/perl-ldap-0.53/lib/Net/LDAP.pod
>
> relevant code in CustomerUser/LDAP.pm
>  my %Users;
>     for my $entry ( $Result->all_entries() ) {
>
>         my $CustomerString = '';
>         for my $Field (@attrs) {
>
>             my $FieldValue = $entry->get_value($Field); # <==
> http://search.cpan.org/~marschap/perl-ldap-0.53/lib/Net/LDAP/Entry.pod *
>             $FieldValue = defined $FieldValue ? $FieldValue : '';
>
>             $CustomerString .= $Self->_ConvertFrom($FieldValue) . ' ';
>         }
>
>         my $KeyValue = $entry->get_value( $Self->{CustomerKey} );
>         $KeyValue = defined $KeyValue ? $KeyValue : '';
>
>         $Users{ $Self->_ConvertFrom($KeyValue) } = $CustomerString;
>     }
>
> * $FieldValue will be the first value for the $Field attribute
>
> changing
> my $FieldValue = $entry->get_value($Field);
> to
> my $FieldValue = $entry->get_value($Field, asref => 1);
>
> makes it a reference to an array.
> to deref
> @{ $FieldValue };
>
> to make it a CSV list:
> $FieldValue = join( ',', @{ $FieldValue } );
>
> http://www.perlmonks.org/?node_id=30279
>
> At least, that's what I'd consider doing. Haven't tried it. Your results
> may vary.
>
>
> On Sun, Feb 24, 2013 at 9:40 AM, GARDAIS Ionel 
> <[email protected]>wrote:
>
>>  Hi list,
>>
>>  According to the doc, CustomerIDs can be pulled from a LDAP customer
>> backend if the declared attribute contains a list of customer ids separated
>> by commas. (see
>> http://doc.otrs.org/3.2/en/html/external-backends.html#multi-customer-ids-ldap
>> )
>>
>>  We use an ActiveDirectory as user repository an plan to use the
>> directReports/manager attributes.
>> That is, for a manager, asking for the directReports attribute return a
>> list of reporters.
>>
>>  Is it possible to set the LDAP attribute to an attribute that returns
>> multiple values ?
>> I guess if not, I should try to adapt Kernel/System/CustomerUser/LDAP.pm
>> for that purpose by myself ?
>>
>>  Thanks for your feedback,
>> Ionel
>>
>> --
>> This message and any attachments (the message) are confidential and
>> intended solely for the addressees.
>> Any unauthorised use, dissemination or reproduction is strictly
>> prohibited.
>> The sender does not accept liability for any errors or omissions in the
>> contents of this message arising as a result of e-mail transmission.
>>
>> ---------------------------------------------------------------------
>> OTRS mailing list: otrs - Webpage: http://otrs.org/
>> Archive: http://lists.otrs.org/pipermail/otrs
>> To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
>>
>
>
---------------------------------------------------------------------
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs

Reply via email to