diff --git a/caldav.php b/caldav.php new file mode 100644 index 0000000..a1718da --- /dev/null +++ b/caldav.php @@ -0,0 +1,23 @@ + diff --git a/ldap.cfg.example b/ldap.cfg.example index 8cc4c6c..5c4931a 100644 --- a/ldap.cfg.example +++ b/ldap.cfg.example @@ -33,6 +33,12 @@ $ldap_nonascii_desc = 'Domain'; $ldap_nonascii_uri = "ldap://$ldap_host/$ldap_base??sub?(objectClass=posixAccount)"; $quicktext_default_import = '/home/exchange/quicktext.xml'; $messenger_save_dir = '/tmp'; +//Caldav +$caldav_enable = true; +$caldav_base_url = 'https://calendar.example.com/remote.php/dav/calendars/'; +$caldav_entries = array ( + array (name => 'Personal', id => 'personal', color => '#3300ff', uuid => uniqid()) +); // Signature $siga_marketing = "Marketing bullshit
"; $siga_prefix = "Best regards, "; diff --git a/ldap.defaults.php b/ldap.defaults.php index 1f613bb..412306c 100644 --- a/ldap.defaults.php +++ b/ldap.defaults.php @@ -5,4 +5,17 @@ $ldap_givenname = ''; $ldap_sn = ''; $ldap_title = ''; $ldap_mail = ''; +$ldap_attributes = array( + "gidnumber", + "givenname", + "sn", + "title", + "mail", + "telephonenumber", + "telexnumber", + "pager", + "homephone", + "entryuuid" +); + ?> diff --git a/ldap.settings.php b/ldap.settings.php index 6be5bae..8ff2219 100644 --- a/ldap.settings.php +++ b/ldap.settings.php @@ -79,6 +79,7 @@ try { defaultPref("quicktext.defaultImport", "$quicktext_default_import"); defaultPref("quicktext.firstTime", false); defaultPref("messenger.save.dir", "$messenger_save_dir"); + $caldav_settings lockPref("mail.identity.id1.htmlSigFormat", true); lockPref("mail.identity.id1.htmlSigText", "$signature"); } catch(e) { diff --git a/ldap.vars.php b/ldap.vars.php index 91d010e..1c5aaf7 100644 --- a/ldap.vars.php +++ b/ldap.vars.php @@ -7,4 +7,5 @@ $ldap_mail = ($info[0]["mail"][0]); $ldap_givenname_exploded = explode(" ",$ldap_givenname); $ldap_givenname_exploded = $ldap_givenname_exploded[0]; $ldap_mail_replaced = preg_replace('+@+','%40', $ldap_mail); +$ldap_entryuuid = $info[0]["entryuuid"][0]; ?> diff --git a/thunderbird.php b/thunderbird.php index cad396d..e3540f7 100644 --- a/thunderbird.php +++ b/thunderbird.php @@ -5,6 +5,7 @@ require_once 'ldap.cfg.php'; require_once 'ldap.defaults.php'; require_once 'ldap.siga.php'; +require_once 'caldav.php'; if(empty($_GET['user'])) { exit('Error: user not present'); @@ -20,7 +21,7 @@ if(!$ldap_bind) { exit('Error (' . ldap_errno($link) . '): ' . $ldap_error . "\n"); } -$result_uid = ldap_search($link, $ldap_base, $ldap_filter); +$result_uid = ldap_search($link, $ldap_base, $ldap_filter, $ldap_attributes); $entry_uid = ldap_first_entry($link, $result_uid); if($entry_uid == false) { @@ -82,6 +83,10 @@ else { } } +if ($caldav_enable == true) { + $caldav_settings = makeCaldavSettings($caldav_entries, $caldav_base_url, $ldap_entryuuid); +} + ldap_unbind($link); require_once 'ldap.settings.php';