Changeset e83f035 in github
- Timestamp:
- Aug 29, 2009 2:41:17 PM (4 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- b4fa591
- Parents:
- 0131ec9
- Files:
-
- 4 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcube_ldap.php (modified) (1 diff)
-
program/js/app.js (modified) (5 diffs)
-
program/steps/addressbook/save.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
r0131ec9 re83f035 2 2 =========================== 3 3 4 - Fix LDAP contact update when RDN field is changed (#1485788) 4 5 - Fix LDAP attributes case senitivity problems (#1485830) 5 6 - Fix LDAP addressbook browsing when only one directory is used (#1486022) -
program/include/rcube_ldap.php
r0131ec9 re83f035 481 481 } // end foreach 482 482 483 $dn = base64_decode($id); 484 483 485 // Update the entry as required. 484 $dn = base64_decode($id);485 486 if (!empty($deletedata)) { 486 487 // Delete the fields. 487 $res = ldap_mod_del($this->conn, $dn, $deletedata); 488 if ($res === FALSE) { 488 if (!ldap_mod_del($this->conn, $dn, $deletedata)) 489 489 return false; 490 } // end if 491 492 if (!empty($replacedata)) { 493 // Handle RDN change 494 if ($replacedata[$this->prop['LDAP_rdn']]) { 495 $newdn = $this->prop['LDAP_rdn'].'='.$replacedata[$this->prop['LDAP_rdn']].','.$this->prop['base_dn']; 496 if ($dn != $newdn) { 497 $newrdn = $this->prop['LDAP_rdn'].'='.$replacedata[$this->prop['LDAP_rdn']]; 498 unset($replacedata[$this->prop['LDAP_rdn']]); 499 } 500 } 501 // Replace the fields. 502 if (!empty($replacedata)) { 503 if (!ldap_mod_replace($this->conn, $dn, $replacedata)) 504 return false; 490 505 } // end if 491 506 } // end if 492 507 493 if (!empty($replacedata)) {494 // Replace the fields.495 $res = ldap_mod_replace($this->conn, $dn, $replacedata);496 if ($res === FALSE) {497 return false;498 } // end if499 } // end if500 501 508 if (!empty($newdata)) { 502 509 // Add the fields. 503 $res = ldap_mod_add($this->conn, $dn, $newdata); 504 if ($res === FALSE) { 510 if (!ldap_mod_add($this->conn, $dn, $newdata)) 505 511 return false; 506 } // end if507 512 } // end if 513 514 // Handle RDN change 515 if (!empty($newrdn)) { 516 if (@ldap_rename($this->conn, $dn, $newrdn, NULL, TRUE)) 517 return base64_encode($newdn); 518 } 508 519 509 520 return true; -
program/js/app.js
re0896df re83f035 2927 2927 2928 2928 // update a contact record in the list 2929 this.update_contact_row = function(cid, cols_arr )2929 this.update_contact_row = function(cid, cols_arr, newcid) 2930 2930 { 2931 2931 var row; … … 2935 2935 $(row.cells[c]).html(cols_arr[c]); 2936 2936 2937 // cid change 2938 if (newcid) { 2939 row.id = 'rcmrow' + newcid; 2940 this.contact_list.remove_row(cid); 2941 this.contact_list.init_row(row); 2942 this.contact_list.selection[0] = newcid; 2943 row.style.display = ''; 2944 } 2945 2937 2946 return true; 2938 2947 } … … 2940 2949 return false; 2941 2950 }; 2951 2952 // add row to contacts list 2953 this.add_contact_row = function(cid, cols, select) 2954 { 2955 if (!this.gui_objects.contactslist || !this.gui_objects.contactslist.tBodies[0]) 2956 return false; 2957 2958 var tbody = this.gui_objects.contactslist.tBodies[0]; 2959 var rowcount = tbody.rows.length; 2960 var even = rowcount%2; 2961 2962 var row = document.createElement('tr'); 2963 row.id = 'rcmrow'+cid; 2964 row.className = 'contact '+(even ? 'even' : 'odd'); 2965 2966 if (this.contact_list.in_selection(cid)) 2967 row.className += ' selected'; 2968 2969 // add each submitted col 2970 for (var c in cols) { 2971 col = document.createElement('td'); 2972 col.className = String(c).toLowerCase(); 2973 col.innerHTML = cols[c]; 2974 row.appendChild(col); 2975 } 2976 2977 this.contact_list.insert_row(row); 2978 2979 this.enable_command('export', (this.contact_list.rowcount > 0)); 2980 }; 2942 2981 2943 2982 … … 2994 3033 }; 2995 3034 2996 // load contactrecord3035 // load identity record 2997 3036 this.load_identity = function(id, action) 2998 3037 { … … 3885 3924 } 3886 3925 3887 // add row to contacts list3888 this.add_contact_row = function(cid, cols, select)3889 {3890 if (!this.gui_objects.contactslist || !this.gui_objects.contactslist.tBodies[0])3891 return false;3892 3893 var tbody = this.gui_objects.contactslist.tBodies[0];3894 var rowcount = tbody.rows.length;3895 var even = rowcount%2;3896 3897 var row = document.createElement('tr');3898 row.id = 'rcmrow'+cid;3899 row.className = 'contact '+(even ? 'even' : 'odd');3900 3901 if (this.contact_list.in_selection(cid))3902 row.className += ' selected';3903 3904 // add each submitted col3905 for (var c in cols) {3906 col = document.createElement('td');3907 col.className = String(c).toLowerCase();3908 col.innerHTML = cols[c];3909 row.appendChild(col);3910 }3911 3912 this.contact_list.insert_row(row);3913 3914 this.enable_command('export', (this.contact_list.rowcount > 0));3915 };3916 3917 3926 this.toggle_prefer_html = function(checkbox) 3918 3927 { -
program/steps/addressbook/save.inc
r5499336 re83f035 58 58 $a_record = $plugin['record']; 59 59 60 if (!$plugin['abort'] && $CONTACTS->update($cid, $a_record))60 if (!$plugin['abort'] && ($result = $CONTACTS->update($cid, $a_record))) 61 61 { 62 // LDAP DN change 63 if (is_string($result) && strlen($result)>1) { 64 $newcid = $result; 65 // change cid in POST for 'show' action 66 $_POST['_cid'] = $newcid; 67 } 68 62 69 // define list of cols to be displayed 63 70 $a_js_cols = array(); 64 $record = $CONTACTS->get_record($ cid, true);71 $record = $CONTACTS->get_record($newcid ? $newcid : $cid, true); 65 72 66 73 foreach (array('name', 'email') as $col) … … 68 75 69 76 // update the changed col in list 70 $OUTPUT->command('parent.update_contact_row', $cid, $a_js_cols );77 $OUTPUT->command('parent.update_contact_row', $cid, $a_js_cols, $newcid); 71 78 72 79 // show confirmation
Note: See TracChangeset
for help on using the changeset viewer.
