summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-01-17 14:50:45 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-01-17 14:50:45 (GMT)
commit7d0962ff1c4f143d7a8553a7da4e00126b53811b (patch)
tree15c43cb8e1190ab431e83f3d69d22e19ca10c26a
parent2d8591089c85e85da1e0f0c3f719afff4949e1d5 (diff)
downloadkolab-freebusy-7d0962ff1c4f143d7a8553a7da4e00126b53811b.tar.gz
Always use %s placeholders instead of %u; return UTF-8 plaintext
-rw-r--r--config/config.ini.sample4
-rw-r--r--lib/Kolab/FreeBusy/DirectoryLDAP.php4
-rw-r--r--lib/Kolab/FreeBusy/DirectoryStatic.php2
-rw-r--r--lib/Kolab/FreeBusy/Source.php3
-rw-r--r--web/index.php2
5 files changed, 8 insertions, 7 deletions
diff --git a/config/config.ini.sample b/config/config.ini.sample
index 5eb6607..3dfe7cf 100644
--- a/config/config.ini.sample
+++ b/config/config.ini.sample
@@ -37,7 +37,7 @@ level = 300 ; (100 = Debug, 200 = Info, 300 = Warn, 400 = Error, 500 = Critical
[directory "local"]
type = static
filter = "@yourdomain"
-fbsource = file:/var/lib/kolab-freebusy/%u.ifb
+fbsource = file:/var/lib/kolab-freebusy/%s.ifb
;; local Kolab directory server
[directory "kolab-ldap"]
@@ -46,7 +46,7 @@ host = ldap://localhost:389
bind_dn = "uid=kolab-service,ou=Special Users,dc=yourdomain,dc=com"
bind_pw = "<service-bind-pw>"
base_dn = "dc=yourdomain,dc=com"
-filter = "(&(objectClass=kolabInetOrgPerson)(|(uid=%u)(mail=%u)(alias=%u)))"
+filter = "(&(objectClass=kolabInetOrgPerson)(|(uid=%s)(mail=%s)(alias=%s)))"
attributes[] = mail
fbsource = file:/www/kolab-freebusy/data/%mail.ifb
loglevel = 100 ; Debug
diff --git a/lib/Kolab/FreeBusy/DirectoryLDAP.php b/lib/Kolab/FreeBusy/DirectoryLDAP.php
index 54709f2..55a59df 100644
--- a/lib/Kolab/FreeBusy/DirectoryLDAP.php
+++ b/lib/Kolab/FreeBusy/DirectoryLDAP.php
@@ -78,11 +78,11 @@ class DirectoryLDAP extends Directory
*/
public function resolve($user)
{
- $result = array('u' => $user);
+ $result = array('s' => $user);
if ($this->ready) {
// search with configured filter
- $filter = preg_replace('/%u/i', $user, $this->config['filter']);
+ $filter = preg_replace('/%s/i', $user, $this->config['filter']);
$ldapresult = $this->ldap->search($this->config['base_dn'], $filter, 'sub');
// got a valid result
diff --git a/lib/Kolab/FreeBusy/DirectoryStatic.php b/lib/Kolab/FreeBusy/DirectoryStatic.php
index ff55e0e..8424332 100644
--- a/lib/Kolab/FreeBusy/DirectoryStatic.php
+++ b/lib/Kolab/FreeBusy/DirectoryStatic.php
@@ -23,7 +23,7 @@ class DirectoryStatic extends Directory
*/
public function resolve($user)
{
- $result = array('u' => $user);
+ $result = array('s' => $user);
// check if user matches the filter property (if configured)
if (!empty($this->config['filter'])) {
diff --git a/lib/Kolab/FreeBusy/Source.php b/lib/Kolab/FreeBusy/Source.php
index 2d12ebc..96bb547 100644
--- a/lib/Kolab/FreeBusy/Source.php
+++ b/lib/Kolab/FreeBusy/Source.php
@@ -20,7 +20,8 @@ abstract class Source
$config['url'] = $url;
switch ($config['scheme']) {
case 'file': return new SourceFile($config);
- case 'imap': return new SourceIMAP($config);
+ case 'imap':
+ case 'imaps': return new SourceIMAP($config);
case 'http':
case 'https': return new SourceURL($config);
}
diff --git a/web/index.php b/web/index.php
index 93115f2..9d7cc37 100644
--- a/web/index.php
+++ b/web/index.php
@@ -61,7 +61,7 @@ if ($config->isValid()) {
}
#header('Content-type: text/calendar; charset=utf-8', true);
- header('Content-type: text/plain', true);
+ header('Content-type: text/plain; charset=utf-8', true);
// analyse request
$url = array_filter(explode('/', $_SERVER['REDIRECT_URL']));