Changeset 1803f83 in github for program/include/rcube_ldap.php
- Timestamp:
- Nov 28, 2011 12:48:14 PM (18 months ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.8
- Children:
- 50ee4cc
- Parents:
- d6aafdc
- File:
-
- 1 edited
-
program/include/rcube_ldap.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/include/rcube_ldap.php
rd6aafdc r1803f83 1053 1053 1054 1054 $ldap_data = $this->_map_data($save_cols); 1055 $old_data = $record['_raw_attrib']; 1056 1055 1057 foreach ($this->fieldmap as $col => $fld) { 1056 1058 $val = $ldap_data[$fld]; … … 1060 1062 $val = array_filter($val); 1061 1063 // The field does exist compare it to the ldap record. 1062 if ($ record[$col] != $val) {1064 if ($old_data[$fld] != $val) { 1063 1065 // Changed, but find out how. 1064 if (!isset($ record[$col])) {1066 if (!isset($old_data[$fld])) { 1065 1067 // Field was not set prior, need to add it. 1066 1068 $newdata[$fld] = $val; 1067 } // end if1068 else if ($val == '') {1069 } 1070 else if ($val == '') { 1069 1071 // Field supplied is empty, verify that it is not required. 1070 1072 if (!in_array($fld, $this->prop['required_fields'])) { 1071 1073 // It is not, safe to clear. 1072 $deletedata[$fld] = $ record[$col];1073 } // end if1074 $deletedata[$fld] = $old_data[$fld]; 1075 } 1074 1076 } // end elseif 1075 1077 else { 1076 1078 // The data was modified, save it out. 1077 1079 $replacedata[$fld] = $val; 1078 } // end else1080 } 1079 1081 } // end if 1080 1082 } // end if … … 1312 1314 if (!($value = $rec[$lf][$i])) 1313 1315 continue; 1316 1317 $out['_raw_attrib'][$lf][$i] = $value; 1318 1314 1319 if ($rf == 'email' && $this->mail_domain && !strpos($value, '@')) 1315 1320 $out[$rf][] = sprintf('%s@%s', $value, $this->mail_domain); … … 1324 1329 // Make sure name fields aren't arrays (#1488108) 1325 1330 if (is_array($out[$rf]) && in_array($rf, array('name', 'surname', 'firstname', 'middlename', 'nickname'))) { 1326 $out[$rf] = $out[ $rf][0];1331 $out[$rf] = $out['_raw_attrib'][$lf] = $out[$rf][0]; 1327 1332 } 1328 1333 }
Note: See TracChangeset
for help on using the changeset viewer.
