From 722a400e011809eabc555ac93e2b30754a81c9a8 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 26 May 2011 15:04:55 +0200 Subject: [PATCH] Allow setting imap configuration for Horde framework libs --- plugins/kolab_core/rcube_kolab.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/kolab_core/rcube_kolab.php b/plugins/kolab_core/rcube_kolab.php index 3c875ba4..edace4c8 100644 --- a/plugins/kolab_core/rcube_kolab.php +++ b/plugins/kolab_core/rcube_kolab.php @@ -32,16 +32,19 @@ class rcube_kolab return; $rcmail = rcmail::get_instance(); - + + // get password of logged user + $pwd = $rcmail->decrypt($_SESSION['password']); + // load ldap credentials from local config $conf['kolab'] = $rcmail->config->get('kolab'); $conf['kolab']['ldap'] += array('server' => 'ldap://' . $_SESSION['imap_host'] . ':389'); - $conf['kolab']['imap'] = array('server' => $_SESSION['imap_host'], 'port' => $_SESSION['imap_port']); - + $conf['kolab']['imap'] += array('server' => $_SESSION['imap_host'], 'port' => $_SESSION['imap_port']); + // pass the current IMAP authentication credentials to the Horde auth system self::$horde_auth = Auth::singleton('kolab'); - if (self::$horde_auth->authenticate($_SESSION['username'], array('password' => ($pwd = $rcmail->decrypt($_SESSION['password']))), false)) { + if (self::$horde_auth->authenticate($_SESSION['username'], array('password' => $pwd), false)) { $_SESSION['__auth'] = array( 'authenticated' => true, 'userId' => $_SESSION['username'],