[Tickets #9554] Re: store multiple email addresses as separate 'mail' attributes in LDAP
noreply at bugs.horde.org
noreply at bugs.horde.org
Wed Nov 2 21:42:40 UTC 2016
BITTE NICHT AUF DIESE NACHRICHT ANTWORTEN. NACHRICHTEN AN DIESE
E-MAIL-ADRESSE WERDEN NICHT GELESEN.
Ticket-URL: https://bugs.horde.org/ticket/9554
------------------------------------------------------------------------------
Ticket | 9554
Aktualisiert Von | oliverafg at gmx.de
Zusammenfassung | store multiple email addresses as separate 'mail'
| attributes in LDAP
Warteschlange | Turba
Version | Git master
Typ | Enhancement
Status | Accepted
Priorität | 1. Low
Milestone |
Patch |
Zuständige |
------------------------------------------------------------------------------
oliverafg at gmx.de (2016-11-02 21:42) hat geschrieben:
> 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