Changeset 5248 in subversion
- Timestamp:
- Sep 20, 2011 4:09:52 AM (20 months ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 2 edited
-
config/main.inc.php.dist (modified) (1 diff)
-
program/include/rcube_ldap.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/config/main.inc.php.dist
r5210 r5248 589 589 // -> in this case, assure that groups and contacts are separated due to the concernig filters! 590 590 'groups' => array( 591 'base_dn' => '', 591 'base_dn' => '', 592 592 'filter' => '(objectClass=groupOfNames)', 593 593 'object_classes' => array("top", "groupOfNames"), 594 // name of the member attribute, e.g. uniqueMember 595 'member_attr' => 'member', 594 596 ), 595 597 ); -
trunk/roundcubemail/program/include/rcube_ldap.php
r5243 r5248 74 74 75 75 // check if groups are configured 76 if (is_array($p['groups']) and count($p['groups']))76 if (is_array($p['groups']) && count($p['groups'])) { 77 77 $this->groups = true; 78 // set member field 79 if (!empty($p['groups']['member_attr'])) 80 $this->prop['member_attr'] = $p['groups']['member_attr']; 81 else if (empty($p['member_attr'])) 82 $this->prop['member_attr'] = 'member'; 83 } 78 84 79 85 // fieldmap property is given … … 116 122 $this->prop['required_fields'][$key] = $this->_attr_name(strtolower($val)); 117 123 118 $this->sort_col = is_array($p['sort']) ? $p['sort'][0] : $p['sort'];119 $this->debug = $debug;124 $this->sort_col = is_array($p['sort']) ? $p['sort'][0] : $p['sort']; 125 $this->debug = $debug; 120 126 $this->mail_domain = $mail_domain; 121 127 … … 1106 1112 $this->_debug("C: Search [$filter][dn: $base_dn]"); 1107 1113 1108 $res = @ldap_search($this->conn, $base_dn, $filter, array('cn', 'member'));1114 $res = @ldap_search($this->conn, $base_dn, $filter, array('cn', $this->prop['member_attr'])); 1109 1115 if ($res === false) 1110 1116 { … … 1126 1132 $groups[$group_id]['ID'] = $group_id; 1127 1133 $groups[$group_id]['name'] = $group_name; 1128 $groups[$group_id]['members'] = $ldap_data[$i][ 'member'];1134 $groups[$group_id]['members'] = $ldap_data[$i][$this->prop['member_attr']]; 1129 1135 $group_sortnames[] = strtolower($group_name); 1130 1136 } … … 1154 1160 'objectClass' => $this->prop['groups']['object_classes'], 1155 1161 'cn' => $group_name, 1156 'member'=> '',1162 $this->prop['member_attr'] => '', 1157 1163 ); 1158 1164 … … 1248 1254 $this->list_groups(); 1249 1255 1250 $base_dn = $this->groups_base_dn; 1251 $group_name = $this->group_cache[$group_id]['name']; 1252 $group_dn = "cn=$group_name,$base_dn"; 1256 $base_dn = $this->groups_base_dn; 1257 $group_name = $this->group_cache[$group_id]['name']; 1258 $member_attr = $this->prop['member_attr']; 1259 $group_dn = "cn=$group_name,$base_dn"; 1253 1260 1254 1261 $new_attrs = array(); 1255 1262 foreach (explode(",", $contact_ids) as $id) 1256 $new_attrs[ 'member'][] = self::dn_decode($id);1263 $new_attrs[$member_attr][] = self::dn_decode($id); 1257 1264 1258 1265 $this->_debug("C: Add [dn: $group_dn]: ".print_r($new_attrs, true)); … … 1283 1290 $this->list_groups(); 1284 1291 1285 $base_dn = $this->groups_base_dn; 1286 $group_name = $this->group_cache[$group_id]['name']; 1287 $group_dn = "cn=$group_name,$base_dn"; 1292 $base_dn = $this->groups_base_dn; 1293 $group_name = $this->group_cache[$group_id]['name']; 1294 $member_attr = $this->prop['member_attr']; 1295 $group_dn = "cn=$group_name,$base_dn"; 1288 1296 1289 1297 $del_attrs = array(); 1290 1298 foreach (explode(",", $contact_ids) as $id) 1291 $del_attrs[ 'member'][] = self::dn_decode($id);1299 $del_attrs[$member_attr][] = self::dn_decode($id); 1292 1300 1293 1301 $this->_debug("C: Delete [dn: $group_dn]: ".print_r($del_attrs, true)); … … 1319 1327 return array(); 1320 1328 1321 $base_dn = $this->groups_base_dn; 1322 $contact_dn = self::dn_decode($contact_id); 1323 $filter = strtr("(member=$contact_dn)", array('\\' => '\\\\')); 1329 $base_dn = $this->groups_base_dn; 1330 $contact_dn = self::dn_decode($contact_id); 1331 $member_attr = $this->prop['member_attr']; 1332 $filter = strtr("($member_attr=$contact_dn)", array('\\' => '\\\\')); 1324 1333 1325 1334 $this->_debug("C: Search [$filter][dn: $base_dn]");
Note: See TracChangeset
for help on using the changeset viewer.
