Changes of Revision 20

1777-lc_attributes.patch Deleted
x
 
1
@@ -1,52 +0,0 @@
2
-commit d2440636d44761095b55d89e89d866a259115938
3
-Author: Thomas Bruederli <bruederli@kolabsys.com>
4
-Date:   Thu Apr 25 09:04:24 2013 +0200
5
-
6
-    Convert certain attributes to lower-case as defined by config (#1777)
7
-
8
-diff --git a/config/config.ini.sample b/config/config.ini.sample
9
-index fbcbdfa..62437d3 100644
10
---- a/config/config.ini.sample
11
-+++ b/config/config.ini.sample
12
-@@ -48,6 +48,7 @@ bind_pw = "<service-bind-pw>"
13
- base_dn = "dc=yourdomain,dc=com"
14
- filter = "(&(objectClass=kolabInetOrgPerson)(|(uid=%s)(mail=%s)(alias=%s)))"
15
- attributes[] = mail
16
-+lc_attributes[] = mail
17
- fbsource = file:/www/kolab-freebusy/data/%mail.ifb
18
- loglevel = 100  ; Debug
19
- 
20
-diff --git a/lib/Kolab/FreeBusy/Directory.php b/lib/Kolab/FreeBusy/Directory.php
21
-index 97fee75..dba6014 100644
22
---- a/lib/Kolab/FreeBusy/Directory.php
23
-+++ b/lib/Kolab/FreeBusy/Directory.php
24
-@@ -53,7 +53,7 @@ abstract class Directory
25
-           $fbsource = $this->config['fbsource'];
26
-           if ($source = Source::Factory($fbsource)) {
27
-               // forward request to Source instance
28
--              if ($data = $source->getFreeBusyData($user, $extended)) {
29
-+              if ($data = $source->getFreeBusyData($this->postprocessAttrib($user), $extended)) {
30
-                   // send data through the according format converter
31
-                   $converter = Format::factory($this->config['format']);
32
-                   $data = $converter->toVCalendar($data);
33
-@@ -66,4 +66,19 @@ abstract class Directory
34
-       return false;
35
-   }
36
- 
37
-+  /**
38
-+   * Modify attribute values according to config
39
-+   */
40
-+  protected function postprocessAttrib($attrib)
41
-+  {
42
-+      if (!empty($this->config['lc_attributes'])) {
43
-+          foreach ((array)$this->config['lc_attributes'] as $key) {
44
-+              if (!empty($attrib[$key]))
45
-+                  $attrib[$key] = strtolower($attrib[$key]);
46
-+          }
47
-+      }
48
-+
49
-+      return $attrib;
50
-+  }
51
-+
52
- }
53
-\ No newline at end of file
54