Changeset 7551896 in github
- Timestamp:
- Aug 12, 2011 3:01:47 AM (22 months ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- f4c3649
- Parents:
- a170304
- File:
-
- 1 edited
-
program/include/rcube_ldap.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/include/rcube_ldap.php
ra170304 r7551896 893 893 $function = $this->prop['scope'] == 'sub' ? 'ldap_search' : ($this->prop['scope'] == 'base' ? 'ldap_read' : 'ldap_list'); 894 894 895 $this->_debug("C: Search [ ".$filter."]");895 $this->_debug("C: Search [$filter]"); 896 896 897 897 // when using VLV, we get the total count by... … … 906 906 else // ...or by fetching all records dn and count them 907 907 $this->vlv_count = $this->_exec_search(true); 908 908 909 909 $this->vlv_active = $this->_vlv_set_controls(); 910 910 } … … 1097 1097 $filter = $this->prop['groups']['filter']; 1098 1098 1099 $this->_debug("C: Search [$filter][dn: $base_dn]"); 1100 1099 1101 $res = ldap_search($this->conn, $base_dn, $filter, array('cn','member')); 1100 1102 if ($res === false) … … 1104 1106 return array(); 1105 1107 } 1108 1106 1109 $ldap_data = ldap_get_entries($this->conn, $res); 1110 $this->_debug("S: ".ldap_count_entries($this->conn, $res)." record(s)"); 1107 1111 1108 1112 $groups = array(); … … 1147 1151 ); 1148 1152 1153 $this->_debug("C: Add [dn: $new_dn]: ".print_r($new_entry, true)); 1154 1149 1155 $res = ldap_add($this->conn, $new_dn, $new_entry); 1150 1156 if ($res === false) … … 1154 1160 return false; 1155 1161 } 1162 1163 $this->_debug("S: OK"); 1164 1156 1165 return array('id' => $new_gid, 'name' => $group_name); 1157 1166 } … … 1170 1179 $base_dn = $this->groups_base_dn; 1171 1180 $group_name = $this->group_cache[$group_id]['name']; 1172 1173 1181 $del_dn = "cn=$group_name,$base_dn"; 1182 1183 $this->_debug("C: Delete [dn: $del_dn]"); 1184 1174 1185 $res = ldap_delete($this->conn, $del_dn); 1175 1186 if ($res === false) … … 1179 1190 return false; 1180 1191 } 1192 1193 $this->_debug("S: OK"); 1194 1181 1195 return true; 1182 1196 } … … 1201 1215 $new_gid = base64_encode($new_name); 1202 1216 1217 $this->_debug("C: Rename [dn: $old_dn] [dn: $new_rdn]"); 1218 1203 1219 $res = ldap_rename($this->conn, $old_dn, $new_rdn, NULL, TRUE); 1204 1220 if ($res === false) … … 1208 1224 return false; 1209 1225 } 1226 1227 $this->_debug("S: OK"); 1228 1210 1229 return $new_name; 1211 1230 } … … 1231 1250 $new_attrs['member'][] = base64_decode($id); 1232 1251 1252 $this->_debug("C: Add [dn: $group_dn]: ".print_r($new_attrs, true)); 1253 1233 1254 $res = ldap_mod_add($this->conn, $group_dn, $new_attrs); 1234 1255 if ($res === false) … … 1238 1259 return 0; 1239 1260 } 1261 1262 $this->_debug("S: OK"); 1263 1240 1264 return count($new_attrs['member']); 1241 1265 } … … 1261 1285 $del_attrs['member'][] = base64_decode($id); 1262 1286 1287 $this->_debug("C: Delete [dn: $group_dn]: ".print_r($del_attrs, true)); 1288 1263 1289 $res = ldap_mod_del($this->conn, $group_dn, $del_attrs); 1264 1290 if ($res === false) … … 1268 1294 return 0; 1269 1295 } 1296 1297 $this->_debug("S: OK"); 1298 1270 1299 return count($del_attrs['member']); 1271 1300 } … … 1288 1317 $filter = "(member=$contact_dn)"; 1289 1318 1319 $this->_debug("C: Search [$filter][dn: $base_dn]"); 1320 1290 1321 $res = ldap_search($this->conn, $base_dn, $filter, array('cn')); 1291 1322 if ($res === false) … … 1296 1327 } 1297 1328 $ldap_data = ldap_get_entries($this->conn, $res); 1329 $this->_debug("S: ".ldap_count_entries($this->conn, $res)." record(s)"); 1298 1330 1299 1331 $groups = array();
Note: See TracChangeset
for help on using the changeset viewer.
