Changeset d1e08fc in github
- Timestamp:
- Apr 15, 2011 11:55:38 AM (2 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- ef27a6a
- Parents:
- 1f6ab35
- Files:
-
- 3 edited
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (1 diff)
-
program/include/rcube_ldap.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
rbf80b5a rd1e08fc 2 2 =========================== 3 3 4 - Replace LDAP vars in group queries (#1487837) 4 5 - Fix vcard folding with uncode characters (#1487868) 5 6 - Keep all submitted data if contact form validation fails (#1487865) -
config/main.inc.php.dist
rae39c47 rd1e08fc 513 513 'sort' => 'cn', // The field to sort the listing by. 514 514 'scope' => 'sub', // search mode: sub|base|list 515 'filter' => ' ', // used for basic listing (if not empty) and will be &'d with search queries. example: status=act515 'filter' => '(objectClass=inetOrgPerson)', // used for basic listing (if not empty) and will be &'d with search queries. example: status=act 516 516 'fuzzy_search' => true, // server allows wildcard search 517 517 'sizelimit' => '0', // Enables you to limit the count of entries fetched. Setting this to 0 means no limit. 518 518 'timelimit' => '0', // Sets the number of seconds how long is spend on the search. Setting this to 0 means no limit. 519 // definition for groups, set to false if no groups are supported 519 520 // definition for contact groups (uncomment if no groups are supported) 521 // for the groups base_dn, the user replacements %fu, %u, $d and %dc work as for base_dn (see above) 522 // if the groups base_dn is empty, the contact base_dn is used for the groups as well 523 // -> in thist case, assure that groups and contacts are seperated due to the concernig filters! 520 524 'groups' => array( 521 'base_dn' => ' ou=groups,ou=rcabook,dc=localhost',525 'base_dn' => '', 522 526 'filter' => '(objectClass=groupOfNames)', 527 'object_classes' => array("top", "groupOfNames"), 523 528 ), 524 529 ); -
program/include/rcube_ldap.php
r15e9441 rd1e08fc 50 50 protected $debug = false; 51 51 52 private $base_dn = ''; 53 private $groups_base_dn = ''; 52 54 private $group_cache = array(); 53 55 private $group_members = array(); … … 67 69 68 70 // check if groups are configured 69 if (is_array($p['groups']) )71 if (is_array($p['groups']) and count($p['groups'])) 70 72 $this->groups = true; 71 73 … … 203 205 // Replace the bind_dn and base_dn variables. 204 206 $bind_dn = strtr($bind_dn, $replaces); 205 $ base_dn = strtr($base_dn, $replaces);207 $this->base_dn = strtr($base_dn, $replaces); 206 208 207 209 if (empty($bind_user)) { … … 645 647 646 648 // Build the new entries DN. 647 $dn = $this->prop['LDAP_rdn'].'='.$this->_quote_string($newentry[$this->prop['LDAP_rdn']], true).','.$this-> prop['base_dn'];649 $dn = $this->prop['LDAP_rdn'].'='.$this->_quote_string($newentry[$this->prop['LDAP_rdn']], true).','.$this->base_dn; 648 650 649 651 $this->_debug("C: Add [dn: $dn]: ".print_r($newentry, true)); … … 729 731 $newdn = $this->prop['LDAP_rdn'].'=' 730 732 .$this->_quote_string($replacedata[$this->prop['LDAP_rdn']], true) 731 .','.$this-> prop['base_dn'];733 .','.$this->base_dn; 732 734 if ($dn != $newdn) { 733 735 $newrdn = $this->prop['LDAP_rdn'].'=' … … 838 840 $this->_debug("C: Search [".$filter."]"); 839 841 840 if ($this->ldap_result = @$function($this->conn, $this-> prop['base_dn'], $filter,842 if ($this->ldap_result = @$function($this->conn, $this->base_dn, $filter, 841 843 array_values($this->fieldmap), 0, (int) $this->prop['sizelimit'], (int) $this->prop['timelimit'])) 842 844 { … … 973 975 function list_groups($search = null) 974 976 { 977 global $RCMAIL; 978 975 979 if (!$this->groups) 976 980 return array(); 977 981 978 $base_dn = $this->prop['groups']['base_dn']; 979 $filter = '(objectClass=groupOfNames)'; 982 $this->groups_base_dn = ($this->prop['groups']['base_dn']) ? 983 $this->prop['groups']['base_dn'] : $this->base_dn; 984 985 // replace user specific dn 986 if ($this->prop['user_specific']) 987 { 988 $fu = $RCMAIL->user->get_username(); 989 list($u, $d) = explode('@', $fu); 990 $dc = 'dc='.strtr($d, array('.' => ',dc=')); 991 $replaces = array('%dc' => $dc, '%d' => $d, '%fu' => $fu, '%u' => $u); 992 993 $this->groups_base_dn = strtr($this->groups_base_dn, $replaces);; 994 } 995 996 $base_dn = $this->groups_base_dn; 997 $filter = $this->prop['groups']['filter']; 980 998 981 999 $res = ldap_search($this->conn, $base_dn, $filter, array('cn','member')); … … 1016 1034 $this->list_groups(); 1017 1035 1018 $base_dn = $this-> prop['groups']['base_dn'];1036 $base_dn = $this->groups_base_dn; 1019 1037 $new_dn = "cn=$group_name,$base_dn"; 1020 1038 $new_gid = base64_encode($group_name); 1021 1039 1022 1040 $new_entry = array( 1023 'objectClass' => array('top', 'groupOfNames'),1041 'objectClass' => $this->prop['groups']['object_classes'], 1024 1042 'cn' => $group_name, 1025 1043 'member' => '', … … 1047 1065 $this->list_groups(); 1048 1066 1049 $base_dn = $this-> prop['groups']['base_dn'];1067 $base_dn = $this->groups_base_dn; 1050 1068 $group_name = $this->group_cache[$group_id]['name']; 1051 1069 … … 1074 1092 $this->list_groups(); 1075 1093 1076 $base_dn = $this-> prop['groups']['base_dn'];1094 $base_dn = $this->groups_base_dn; 1077 1095 $group_name = $this->group_cache[$group_id]['name']; 1078 1096 $old_dn = "cn=$group_name,$base_dn"; … … 1102 1120 $this->list_groups(); 1103 1121 1104 $base_dn = $this-> prop['groups']['base_dn'];1122 $base_dn = $this->groups_base_dn; 1105 1123 $group_name = $this->group_cache[$group_id]['name']; 1106 1124 $group_dn = "cn=$group_name,$base_dn"; … … 1132 1150 $this->list_groups(); 1133 1151 1134 $base_dn = $this-> prop['groups']['base_dn'];1152 $base_dn = $this->groups_base_dn; 1135 1153 $group_name = $this->group_cache[$group_id]['name']; 1136 1154 $group_dn = "cn=$group_name,$base_dn"; … … 1163 1181 return array(); 1164 1182 1165 $base_dn = $this-> prop['groups']['base_dn'];1183 $base_dn = $this->groups_base_dn; 1166 1184 $contact_dn = base64_decode($contact_id); 1167 1185 $filter = "(member=$contact_dn)";
Note: See TracChangeset
for help on using the changeset viewer.
