summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-09-11 15:31:19 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-09-11 15:31:19 (GMT)
commit0d129f145c127aebba73a26da79a927f8a8d7724 (patch)
tree1bedf1186f449fea529f590c8ad17f66d423e84d
parent998829f6df3b21cb50c08db39d6469fd43dec4be (diff)
downloadroundcubemail-plugins-kolab-0d129f145c127aebba73a26da79a927f8a8d7724.tar.gz
Add the possibility to set the a mailhost attribute value to be used as the IMAP server address to connect to.
-rw-r--r--plugins/kolab_auth/kolab_auth.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/kolab_auth/kolab_auth.php b/plugins/kolab_auth/kolab_auth.php
index f511949..ddd4539 100644
--- a/plugins/kolab_auth/kolab_auth.php
+++ b/plugins/kolab_auth/kolab_auth.php
@@ -301,11 +301,21 @@ class kolab_auth extends rcube_plugin
$email_attr = $rcmail->config->get('kolab_auth_email');
$org_attr = $rcmail->config->get('kolab_auth_organization');
$role_attr = $rcmail->config->get('kolab_auth_role');
+ $imap_attr = $rcmail->config->get('kolab_auth_mailhost');
if (!empty($role_attr) && !empty($record[$role_attr])) {
$_SESSION['user_roledns'] = (array)($record[$role_attr]);
}
+ if (!empty($imap_attr) && !empty($record[$role_attr])) {
+ $default_host = $rcmail->config->get('default_host');
+ if (!empty($default_host)) {
+ rcube::write_log("errors", "Both default host and kolab_auth_mailhost set. Incompatible.");
+ } else {
+ $args['host'] = "tls://" . $record[$role_attr];
+ }
+ }
+
// Login As...
if (!empty($loginas) && $admin_login) {
// Authenticate to LDAP