[Tickets #9554] Re: store multiple email addresses as separate 'mail' attributes in LDAP
noreply at bugs.horde.org
noreply at bugs.horde.org
Sun Mar 12 21:23:57 UTC 2017
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: https://bugs.horde.org/ticket/9554
------------------------------------------------------------------------------
Ticket | 9554
Updated By | vectro at vectro.org
Summary | store multiple email addresses as separate 'mail'
| attributes in LDAP
Queue | Turba
Version | Git master
Type | Enhancement
State | Accepted
Priority | 1. Low
Milestone |
Patch |
Owners |
------------------------------------------------------------------------------
oliverafg at gmx.de (2016-11-02 21:42) wrote:
> 1) The email form field always returns a single value, though we
> could of course split this up again, or add an option to return an
> array instead.
> 2) But more important, there isn't any way in Turba to store one
> field into several attributes. We do have composite fields, but
> these store in a *fixed* number of *different* attributes, not in a
> *variable* number of the *same* attribute. There is no
> infrastructure for that at all, so this is a larger undertaking.
Is this necessary at all?
As far as I can say, the emails (multi_value) field works fine with
IMP and ActiveSync.
It works with ActiveSync in the expected way, the first three email
addresses from emails are provided as email1, email2 and email3 to an
activesync device and read this way from the device. (three email
address are the limit of activesync)
this happens ins turba/lib/Driver.php at line 2690:
case 'emails':
$address = 1;
foreach (explode(',', $value) as $email) {
while ($address <= 3 &&
$message->{'email' . $address . 'address'}) {
$address++;
}
if ($address > 3) {
break;
}
$message->{'email' . $address . 'address'} = $email;
$address++;
}
break;
A smiliar code snippet is there for vcards.
For LDAP I find the "array_merge" inside the _read function off
Ldap.php. In funtion _write, there is nothing.
My suggestions:
1) generic version
at line 304:
if source is comma seperated array and target mutli value
for i in array ...
this one might be dangerous with other fields als children/child
2)
Or a hardcoded version just for "emails"
somehow ugly but works and no side effects
3)
in backends.local.php the opportunity/example for 2)
My php skills are just not good enough at the moment :(
More information about the bugs
mailing list