- Add possibility to set global Horde config

This commit is contained in:
Aleksander Machniak 2011-06-01 10:18:44 +02:00
parent c51ba8d51d
commit 0bd3160968
2 changed files with 17 additions and 8 deletions

View file

@ -8,4 +8,7 @@ $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']['phppw'] = '<ldap-pwd-goes-here>';
// Global Horde classes configuration (e.g. Cache settings)
$rcmail_config['kolab']['global'] = array();
?>

View file

@ -18,19 +18,19 @@ class rcube_kolab
{
private static $horde_auth;
private static $ready = false;
/**
* Setup the environment needed by the Kolab_* classes to access Kolab data
*/
public static function setup()
{
global $conf;
// setup already done
if (self::$horde_auth)
return;
$rcmail = rcmail::get_instance();
// get password of logged user
@ -38,7 +38,14 @@ class rcube_kolab
// load ldap credentials from local config
$conf['kolab'] = $rcmail->config->get('kolab');
// Set global Horde config (e.g. Cache settings)
if (!empty($conf['kolab']['global'])) {
$conf = array_merge($conf, $conf['kolab']['global']);
unset($conf['kolab']['global']);
}
// Re-set LDAP/IMAP host config
$conf['kolab']['ldap'] += array('server' => 'ldap://' . $_SESSION['imap_host'] . ':389');
$conf['kolab']['imap'] += array('server' => $_SESSION['imap_host'], 'port' => $_SESSION['imap_port']);
@ -54,12 +61,11 @@ class rcube_kolab
Auth::setCredential('password', $pwd);
self::$ready = true;
}
NLS::setCharset('UTF-8');
String::setDefaultCharset('UTF-8');
}
/**
* Get instance of a Kolab (XML) format object
*