Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F6064114
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/plugins/kolab_core/README.txt b/plugins/kolab_core/README.txt
index 87537c0b..751e84fb 100644
--- a/plugins/kolab_core/README.txt
+++ b/plugins/kolab_core/README.txt
@@ -1,32 +1,34 @@
Kolab Integration Plugin README
-------------------------------
This plugin relies on classes from the Horde project. In order to have all
the required files available you need to install the following packages from
Horde:
Horde_Framework
Kolab_Format
Kolab_Storage
Horde_NLS
Horde_DOM
This is best done using PEAR. Make sure that the local PEAR directory is in
the PHP isntall path and execute the following commands to install the
required packages:
pear channel-discover pear.horde.org
pear install horde/Horde_Framework
pear install horde/Horde_DOM
pear install horde/Horde_NLS
pear install horde/Horde_Share
pear install horde/Log
pear install horde/Kolab_Format
pear install horde/Kolab_Storage
+WARNING: This procedure installs Horde4 sources that doesn't work with this plugin!
+
Configuration
-------------
Rename the config.inc.php.dist to config.inc.php within this plugin directory
and add the corresponding values for your local Kolab server.
diff --git a/plugins/kolab_core/rcube_kolab.php b/plugins/kolab_core/rcube_kolab.php
index fb9c975e..3c875ba4 100644
--- a/plugins/kolab_core/rcube_kolab.php
+++ b/plugins/kolab_core/rcube_kolab.php
@@ -1,106 +1,108 @@
<?php
+ini_set('error_reporting', E_ALL&~(E_DEPRECATED | E_NOTICE));
+
require_once 'Horde/Kolab/Storage/List.php';
require_once 'Horde/Kolab/Format.php';
require_once 'Horde/Auth.php';
require_once 'Horde/Auth/kolab.php';
require_once 'Horde/Perms.php';
/**
* Glue class to handle access to the Kolab data using the Kolab_* classes
* from the Horde project.
*
* @author Thomas Bruederli
*/
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();
// 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']);
// 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)) {
$_SESSION['__auth'] = array(
'authenticated' => true,
'userId' => $_SESSION['username'],
'timestamp' => time(),
'remote_addr' => $_SERVER['REMOTE_ADDR'],
);
Auth::setCredential('password', $pwd);
self::$ready = true;
}
NLS::setCharset('UTF-8');
String::setDefaultCharset('UTF-8');
}
/**
* Get instance of a Kolab (XML) format object
*
* @param string Data type (contact,event,task,note)
* @return object Horde_Kolab_Format_XML The format object
*/
public static function get_format($type)
{
self::setup();
return Horde_Kolab_Format::factory('XML', $type);
}
/**
* Get a list of storage folders for the given data type
*
* @param string Data type to list folders for (contact,event,task,note)
* @return array List of Kolab_Folder objects
*/
public static function get_folders($type)
{
self::setup();
$kolab = Kolab_List::singleton();
return self::$ready ? $kolab->getByType($type) : array();
}
/**
* Get storage object for read/write access to the Kolab backend
*
* @param string IMAP folder to access
* @param string Object type to deal with (leave empty for auto-detection using annotations)
* @return object Kolab_Data The data storage object
*/
public static function get_storage($folder, $data_type = null)
{
self::setup();
$kolab = Kolab_List::singleton();
return self::$ready ? $kolab->getFolder($folder)->getData($data_type) : null;
}
/**
* Cleanup session data when done
*/
public static function shutdown()
{
// unset auth data from session. no need to store it persistantly
if (isset($_SESSION['__auth']))
unset($_SESSION['__auth']);
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, May 22, 4:17 AM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
782979
Default Alt Text
(4 KB)
Attached To
Mode
R14 roundcubemail-plugins-kolab
Attached
Detach File
Event Timeline
Log In to Comment