From 5587b34cfa5d04fec8e009288cabd0ffdbf39413 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Wed, 30 Nov 2011 06:05:50 -0500
Subject: [PATCH] Enable buttons having an inner <span> for better CSS styling capabilities
---
program/include/rcube_ldap.php | 31 ++++++++++++++++++-------------
1 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/program/include/rcube_ldap.php b/program/include/rcube_ldap.php
index 6a8ddb9..58e2ca9 100644
--- a/program/include/rcube_ldap.php
+++ b/program/include/rcube_ldap.php
@@ -740,16 +740,16 @@
$function = $this->_scope2func($this->prop['scope']);
$this->ldap_result = @$function($this->conn, $this->base_dn, $this->filter ? $this->filter : '(objectclass=*)',
- array_values($this->fieldmap), 0, (int)$this->prop['sizelimit'], (int)$this->prop['timelimit']);
+ array_values($this->fieldmap), 0, $this->page_size, (int)$this->prop['timelimit']);
$this->result = new rcube_result_set(0);
- if (!$this->ldap_result) {
+ if (!$this->ldap_result) {
$this->_debug("S: ".ldap_error($this->conn));
- return $this->result;
- }
+ return $this->result;
+ }
- $this->_debug("S: ".ldap_count_entries($this->conn, $this->ldap_result)." record(s)");
+ $this->_debug("S: ".ldap_count_entries($this->conn, $this->ldap_result)." record(s)");
// get all entries of this page and post-filter those that really match the query
$search = mb_strtolower($value);
@@ -1052,6 +1052,8 @@
$deletedata = array();
$ldap_data = $this->_map_data($save_cols);
+ $old_data = $record['_raw_attrib'];
+
foreach ($this->fieldmap as $col => $fld) {
$val = $ldap_data[$fld];
if ($fld) {
@@ -1059,23 +1061,23 @@
if (is_array($val))
$val = array_filter($val);
// The field does exist compare it to the ldap record.
- if ($record[$col] != $val) {
+ if ($old_data[$fld] != $val) {
// Changed, but find out how.
- if (!isset($record[$col])) {
+ if (!isset($old_data[$fld])) {
// Field was not set prior, need to add it.
$newdata[$fld] = $val;
- } // end if
- elseif ($val == '') {
+ }
+ 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] = $record[$col];
- } // end if
+ $deletedata[$fld] = $old_data[$fld];
+ }
} // end elseif
else {
// The data was modified, save it out.
$replacedata[$fld] = $val;
- } // end else
+ }
} // end if
} // end if
} // end foreach
@@ -1311,6 +1313,9 @@
for ($i=0; $i < $rec[$lf]['count']; $i++) {
if (!($value = $rec[$lf][$i]))
continue;
+
+ $out['_raw_attrib'][$lf][$i] = $value;
+
if ($rf == 'email' && $this->mail_domain && !strpos($value, '@'))
$out[$rf][] = sprintf('%s@%s', $value, $this->mail_domain);
else if (in_array($rf, array('street','zipcode','locality','country','region')))
@@ -1323,7 +1328,7 @@
// Make sure name fields aren't arrays (#1488108)
if (is_array($out[$rf]) && in_array($rf, array('name', 'surname', 'firstname', 'middlename', 'nickname'))) {
- $out[$rf] = $out[$rf][0];
+ $out[$rf] = $out['_raw_attrib'][$lf] = $out[$rf][0];
}
}
--
Gitblit v1.9.1