Fixed last commit, better handling of malformed/incomplete configuration
This commit is contained in:
parent
7c72f38ef5
commit
a672f926b8
2 changed files with 17 additions and 11 deletions
|
@ -1,14 +1,17 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Sample configuration for Kolab LDAP binding used by Kolab_Storage
|
// Horde/Kolab classes configuration
|
||||||
$rcmail_config['kolab'] = array('imap' => array());
|
$rcmail_config['kolab'] = array(
|
||||||
|
// IMAP configuration (e.g. connection info, namespaces)
|
||||||
|
'imap' => array(),
|
||||||
|
// Global Horde classes configuration (e.g. cache settings)
|
||||||
|
'global' => array(),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Sample configuration for Kolab LDAP binding used by Kolab_Storage
|
||||||
//$rcmail_config['kolab']['ldap']['server'] = '<defaults to imap_host>';
|
//$rcmail_config['kolab']['ldap']['server'] = '<defaults to imap_host>';
|
||||||
$rcmail_config['kolab']['ldap']['basedn'] = 'dc=kolabserver,dc=local';
|
$rcmail_config['kolab']['ldap']['basedn'] = 'dc=kolabserver,dc=local';
|
||||||
$rcmail_config['kolab']['ldap']['phpdn'] = 'cn=nobody,cn=internal,dc=kolabserver,dc=local';
|
$rcmail_config['kolab']['ldap']['phpdn'] = 'cn=nobody,cn=internal,dc=kolabserver,dc=local';
|
||||||
$rcmail_config['kolab']['ldap']['phppw'] = '<ldap-pwd-goes-here>';
|
$rcmail_config['kolab']['ldap']['phppw'] = '<ldap-pwd-goes-here>';
|
||||||
|
|
||||||
// Global Horde classes configuration (e.g. Cache settings)
|
|
||||||
$rcmail_config['kolab']['global'] = array();
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -34,15 +34,15 @@ class rcube_kolab
|
||||||
$rcmail = rcmail::get_instance();
|
$rcmail = rcmail::get_instance();
|
||||||
|
|
||||||
// Set Horde configuration
|
// Set Horde configuration
|
||||||
$GLOBALS['conf']['sql'] = MDB2::parseDSN($rcmail->config->get('db_dsnw'));
|
$conf['sql'] = MDB2::parseDSN($rcmail->config->get('db_dsnw'));
|
||||||
$GLOBALS['conf']['sql']['charset'] = 'utf-8';
|
$conf['sql']['charset'] = 'utf-8';
|
||||||
$GLOBALS['conf']['sql']['phptype'] = 'mysql';
|
$conf['sql']['phptype'] = 'mysql';
|
||||||
|
|
||||||
// get password of logged user
|
// get password of logged user
|
||||||
$pwd = $rcmail->decrypt($_SESSION['password']);
|
$pwd = $rcmail->decrypt($_SESSION['password']);
|
||||||
|
|
||||||
// load ldap credentials from local config
|
// load ldap credentials from local config
|
||||||
$conf['kolab'] = $rcmail->config->get('kolab');
|
$conf['kolab'] = (array) $rcmail->config->get('kolab');
|
||||||
|
|
||||||
// Set global Horde config (e.g. Cache settings)
|
// Set global Horde config (e.g. Cache settings)
|
||||||
if (!empty($conf['kolab']['global'])) {
|
if (!empty($conf['kolab']['global'])) {
|
||||||
|
@ -51,8 +51,11 @@ class rcube_kolab
|
||||||
}
|
}
|
||||||
|
|
||||||
// Re-set LDAP/IMAP host config
|
// Re-set LDAP/IMAP host config
|
||||||
$conf['kolab']['ldap'] = array('server' => 'ldap://' . $_SESSION['imap_host'] . ':389');
|
$ldap = array('server' => 'ldap://' . $_SESSION['imap_host'] . ':389');
|
||||||
$conf['kolab']['imap'] = array('server' => $_SESSION['imap_host'], 'port' => $_SESSION['imap_port']);
|
$imap = array('server' => $_SESSION['imap_host'], 'port' => $_SESSION['imap_port']);
|
||||||
|
|
||||||
|
$conf['kolab']['ldap'] = array_merge($ldap, (array)$conf['kolab']['ldap']);
|
||||||
|
$conf['kolab']['imap'] = array_merge($imap, (array)$conf['kolab']['imap']);
|
||||||
|
|
||||||
// pass the current IMAP authentication credentials to the Horde auth system
|
// pass the current IMAP authentication credentials to the Horde auth system
|
||||||
self::$horde_auth = Auth::singleton('kolab');
|
self::$horde_auth = Auth::singleton('kolab');
|
||||||
|
|
Loading…
Add table
Reference in a new issue