- Fix regression in handling LDAP contact identifiers (#1488959)

pull/15/head^2
Aleksander Machniak 12 years ago
parent 33dc8249fd
commit eafb68b321

@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
- Fix regression in handling LDAP contact identifiers (#1488959)
- Updated translations from Transifex
- Fix buggy error template in a frame (#1488938)
- Add addressbook widget on compose page in classic skin

@ -4225,7 +4225,7 @@ function rcube_webmail()
this.group_member_change('add', cid, dest, to.id);
else {
var lock = this.display_message(this.get_label('copyingcontact'), 'loading'),
post_data = {_cid: cid, _source: source, _to: dest, _togid: to.id, _gid: group};
post_data = {_cid: cid, _source: this.env.source, _to: dest, _togid: to.id, _gid: group};
this.http_post('copy', post_data, lock);
}
@ -4233,7 +4233,7 @@ function rcube_webmail()
// target is an addressbook
else if (to.id != source) {
var lock = this.display_message(this.get_label('copyingcontact'), 'loading'),
post_data = {_cid: cid, _source: source, _to: to.id, _gid: group};
post_data = {_cid: cid, _source: this.env.source, _to: to.id, _gid: group};
this.http_post('copy', post_data, lock);
}

@ -770,19 +770,26 @@ function rcmail_get_cids($filter = null)
}
$cid = explode(',', $cid);
$got_source = strlen($source);
$result = array();
// create per-source contact IDs array
foreach ($cid as $id) {
// get source from decoded ID
// extract source ID from contact ID (it's there in search mode)
// see #1488959 and #1488862 for reference
if (!$got_source) {
if ($sep = strrpos($id, '-')) {
$contact_id = substr($id, 0, $sep);
$source_id = substr($id, $sep+1);
$source_id = (string) substr($id, $sep+1);
if (strlen($source_id)) {
$result[(string)$source_id][] = $contact_id;
$result[$source_id][] = $contact_id;
}
}
}
else {
if (substr($id, -($got_source+1)) == "-$source") {
$id = substr($id, 0, -($got_source+1));
}
$result[$source][] = $id;
}
}

Loading…
Cancel
Save