Projects
Kolab:3.4
kolab-freebusy
1777-lc_attributes.patch
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1777-lc_attributes.patch of Package kolab-freebusy (Revision 19)
Currently displaying revision
19
,
Show latest
commit d2440636d44761095b55d89e89d866a259115938 Author: Thomas Bruederli <bruederli@kolabsys.com> Date: Thu Apr 25 09:04:24 2013 +0200 Convert certain attributes to lower-case as defined by config (#1777) diff --git a/config/config.ini.sample b/config/config.ini.sample index fbcbdfa..62437d3 100644 --- a/config/config.ini.sample +++ b/config/config.ini.sample @@ -48,6 +48,7 @@ bind_pw = "<service-bind-pw>" base_dn = "dc=yourdomain,dc=com" filter = "(&(objectClass=kolabInetOrgPerson)(|(uid=%s)(mail=%s)(alias=%s)))" attributes[] = mail +lc_attributes[] = mail fbsource = file:/www/kolab-freebusy/data/%mail.ifb loglevel = 100 ; Debug diff --git a/lib/Kolab/FreeBusy/Directory.php b/lib/Kolab/FreeBusy/Directory.php index 97fee75..dba6014 100644 --- a/lib/Kolab/FreeBusy/Directory.php +++ b/lib/Kolab/FreeBusy/Directory.php @@ -53,7 +53,7 @@ abstract class Directory $fbsource = $this->config['fbsource']; if ($source = Source::Factory($fbsource)) { // forward request to Source instance - if ($data = $source->getFreeBusyData($user, $extended)) { + if ($data = $source->getFreeBusyData($this->postprocessAttrib($user), $extended)) { // send data through the according format converter $converter = Format::factory($this->config['format']); $data = $converter->toVCalendar($data); @@ -66,4 +66,19 @@ abstract class Directory return false; } + /** + * Modify attribute values according to config + */ + protected function postprocessAttrib($attrib) + { + if (!empty($this->config['lc_attributes'])) { + foreach ((array)$this->config['lc_attributes'] as $key) { + if (!empty($attrib[$key])) + $attrib[$key] = strtolower($attrib[$key]); + } + } + + return $attrib; + } + } \ No newline at end of file
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.