summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-06-25 12:40:32 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-06-25 12:40:32 +0200
commit5e5543df4a15050d01cda90221428206ed9d119e (patch)
tree678e430c2507c118bc1442b537bae2f9500e3f2e
parent3fa561c4cb5d9bae99bf79cd44421fec6b1177da (diff)
downloadpykolab-5e5543df4a15050d01cda90221428206ed9d119e.tar.gz
Add resources from ldap to calendar
-rw-r--r--pykolab/setup/setup_roundcube.py2
-rw-r--r--share/templates/roundcubemail/calendar.inc.php.tpl46
2 files changed, 48 insertions, 0 deletions
diff --git a/pykolab/setup/setup_roundcube.py b/pykolab/setup/setup_roundcube.py
index a9d71a2..ee0c75d 100644
--- a/pykolab/setup/setup_roundcube.py
+++ b/pykolab/setup/setup_roundcube.py
@@ -77,6 +77,8 @@ def execute(*args, **kw):
'ldap_group_base_dn': conf.get('ldap', 'group_base_dn'),
'ldap_group_filter': conf.get('ldap', 'group_filter'),
'ldap_ldap_uri': conf.get('ldap', 'ldap_uri'),
+ 'ldap_resource_base_dn': conf.get('ldap', 'resource_base_dn'),
+ 'ldap_resource_filter': conf.get('ldap', 'resource_filter'),
'ldap_service_bind_dn': conf.get('ldap', 'service_bind_dn'),
'ldap_service_bind_pw': conf.get('ldap', 'service_bind_pw'),
'ldap_user_base_dn': conf.get('ldap', 'user_base_dn'),
diff --git a/share/templates/roundcubemail/calendar.inc.php.tpl b/share/templates/roundcubemail/calendar.inc.php.tpl
index 4761566..d680b4d 100644
--- a/share/templates/roundcubemail/calendar.inc.php.tpl
+++ b/share/templates/roundcubemail/calendar.inc.php.tpl
@@ -9,6 +9,52 @@
\$config['calendar_event_coloring'] = 0;
\$config['calendar_caldav_url'] = 'http://' . \$_SERVER['HTTP_HOST'] . '/iRony/calendars/%u/%i';
+ \$config['calendar_contact_birthdays'] = true;
+
+ \$config['calendar_resources_driver'] = 'ldap';
+
+ \$config['calendar_resources_directory'] = array(
+ 'name' => 'Kolab Resources',
+ 'hosts' => 'localhost,
+ 'port' => 389,
+ 'use_tls' => false,
+ 'base_dn' => '$ldap_resources_base_dn',
+ 'user_specific' => true,
+ 'bind_dn' => '%dn',
+ 'bind_pass' => '',
+ 'search_base_dn' => '$ldap_user_base_dn',
+ 'search_bind_dn' => '$ldap_service_bind_dn',
+ 'search_bind_pw' => '$ldap_service_bind_pw',
+ 'search_filter' => '(&(objectClass=inetOrgPerson)(mail=%fu))',
+ 'ldap_version' => 3,
+ 'filter' => '$ldap_resource_filter',
+ 'search_fields' => array('cn'),
+ 'sort' => array('cn'),
+ 'scope' => 'sub',
+ 'fuzzy_search' => true,
+ 'fieldmap' => array(
+ // Internal => LDAP
+ 'name' => 'cn',
+ 'email' => 'mail',
+ 'owner' => 'owner',
+ 'description' => 'description',
+ 'attributes' => 'kolabdescattribute',
+ 'members' => 'uniquemember',
+ // these mappings are required for owner display
+ 'phone' => 'telephoneNumber',
+ 'mobile' => 'mobile',
+ ),
+
+ 'class_type_map' => array(
+ 'kolabsharedfolder' => 'resource',
+ 'groupofuniquenames' => 'collection',
+ ),
+
+ 'groups' => array(
+ 'name_attr' => 'cn',
+ ),
+ );
+
if (file_exists(RCUBE_CONFIG_DIR . '/' . \$_SERVER["HTTP_HOST"] . '/' . basename(__FILE__))) {
include_once(RCUBE_CONFIG_DIR . '/' . \$_SERVER["HTTP_HOST"] . '/' . basename(__FILE__));
}