From 5f8adabb6286fdcb0ff8a0ea5d1d58f40eef51f4 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 27 Aug 2012 03:28:16 -0400
Subject: [PATCH] Add simple (constructor) tests for Framework classes
---
program/include/rcube_ldap.php | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/program/include/rcube_ldap.php b/program/include/rcube_ldap.php
index f799df2..ad2ccdd 100644
--- a/program/include/rcube_ldap.php
+++ b/program/include/rcube_ldap.php
@@ -139,6 +139,11 @@
unset($this->coltypes[$childcol]); // remove address child col from global coltypes list
}
}
+
+ // at least one address type must be specified
+ if (empty($this->coltypes['address']['subtypes'])) {
+ $this->coltypes['address']['subtypes'] = array('home');
+ }
}
else if ($this->coltypes['address']) {
$this->coltypes['address'] += array('type' => 'textarea', 'childs' => null, 'size' => 40);
@@ -767,7 +772,9 @@
}
// use VLV pseudo-search for autocompletion
- if ($this->prop['vlv_search'] && $this->conn && join(',', (array)$fields) == 'email,name')
+ $rcube = rcube::get_instance();
+
+ if ($this->prop['vlv_search'] && $this->conn && join(',', (array)$fields) == join(',', $rcube->config->get('contactlist_fields')))
{
// add general filter to query
if (!empty($this->prop['filter']) && empty($this->filter))
@@ -1191,8 +1198,11 @@
else if ($val == '') {
// Field supplied is empty, verify that it is not required.
if (!in_array($fld, $this->prop['required_fields'])) {
- // It is not, safe to clear.
- $deletedata[$fld] = $old_data[$fld];
+ // ...It is not, safe to clear.
+ // #1488420: Workaround "ldap_mod_del(): Modify: Inappropriate matching in..."
+ // jpegPhoto attribute require an array() here. It looks to me that it works for other attribs too
+ $deletedata[$fld] = array();
+ //$deletedata[$fld] = $old_data[$fld];
}
}
else {
@@ -2022,12 +2032,12 @@
# a0 = type context-specific/constructed with a length of 06 (6) bytes following
# 02 = type integer with 2 bytes following (offset): 01 01 (ie 1)
# 02 = type integer with 2 bytes following (contentCount): 01 00
-
+
# whith a search string present:
# 81 = type context-specific/constructed with a length of 04 (4) bytes following (the length will change here)
# 81 indicates a user string is present where as a a0 indicates just a offset search
# 81 = type context-specific/constructed with a length of 06 (6) bytes following
-
+
# the following info was taken from the ISO/IEC 8825-1:2003 x.690 standard re: the
# encoding of integer values (note: these values are in
# two-complement form so since offset will never be negative bit 8 of the
@@ -2037,7 +2047,7 @@
# of the second (to the left of first octet) octet:
# a) shall not all be ones; and
# b) shall not all be zero
-
+
if ($search)
{
$search = preg_replace('/[^-[:alpha:] ,.()0-9]+/', '', $search);
@@ -2057,7 +2067,7 @@
// now compute length over $str
$str = self::_ber_addseq($str, 'a0');
}
-
+
// now tack on records per page
$str = "020100" . self::_ber_addseq(self::_ber_encode_int($rpp-1), '02') . $str;
--
Gitblit v1.9.1