From 24f1bf0f91254443ad848686b7afdb1a785e79e8 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Wed, 02 May 2012 17:25:47 -0400
Subject: [PATCH] Fix handling of 'serialzied' LDAP address attributes

---
 program/include/rcube_ldap.php |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/program/include/rcube_ldap.php b/program/include/rcube_ldap.php
index d3067e1..17fb407 100644
--- a/program/include/rcube_ldap.php
+++ b/program/include/rcube_ldap.php
@@ -143,7 +143,14 @@
             }
         }
         else if ($this->coltypes['address']) {
-            $this->coltypes['address'] = array('type' => 'textarea', 'childs' => null, 'limit' => 1, 'size' => 40);
+            $this->coltypes['address'] += array('type' => 'textarea', 'childs' => null, 'size' => 40);
+
+            // 'serialized' means the UI has to present a composite address field
+            if ($this->coltypes['address']['serialized']) {
+                $childprop = array('type' => 'text');
+                $this->coltypes['address']['type'] = 'composite';
+                $this->coltypes['address']['childs'] = array('street' => $childprop, 'locality' => $childprop, 'zipcode' => $childprop, 'country' => $childprop);
+            }
         }
 
         // make sure 'required_fields' is an array

--
Gitblit v1.9.1