Fix variable substitution in ldap host for some use-cases, e.g. new_user_identity (#5544)

pull/5754/head
Aleksander Machniak 8 years ago
parent bc826be106
commit 79613c1e4f

@ -2,6 +2,7 @@ CHANGELOG Roundcube Webmail
===========================
- Managesieve: Fix handling of scripts with nested rules (#5540)
- Fix variable substitution in ldap host for some use-cases, e.g. new_user_identity (#5544)
RELEASE 1.2.3
-------------

@ -228,7 +228,7 @@ class rcube_ldap extends rcube_addressbook
$this->sort_col = is_array($p['sort']) ? $p['sort'][0] : $p['sort'];
$this->debug = $debug;
$this->mail_domain = $mail_domain;
$this->mail_domain = $this->prop['mail_domain'] = $mail_domain;
// initialize cache
$rcube = rcube::get_instance();
@ -260,11 +260,13 @@ class rcube_ldap extends rcube_addressbook
{
$rcube = rcube::get_instance();
if ($this->ready)
if ($this->ready) {
return true;
}
if (!is_array($this->prop['hosts']))
if (!is_array($this->prop['hosts'])) {
$this->prop['hosts'] = array($this->prop['hosts']);
}
// try to connect + bind for every host configured
// with OpenLDAP 2.x ldap_connect() always succeeds but ldap_bind will fail if host isn't reachable

@ -48,7 +48,8 @@ class rcube_ldap_generic extends Net_LDAP3
{
// Net_LDAP3 does not support IDNA yet
// also parse_host() here is very Roundcube specific
$host = rcube_utils::idn_to_ascii(rcube_utils::parse_host($host));
$host = rcube_utils::parse_host($host, $this->config['mail_domain']);
$host = rcube_utils::idn_to_ascii($host);
return parent::connect($host);
}

Loading…
Cancel
Save