Changeset e3caaf5 in github
- Timestamp:
- May 17, 2007 11:58:51 AM (6 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 7198044
- Parents:
- 02342ff
- Files:
-
- 3 edited
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (1 diff)
-
program/include/rcube_ldap.inc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
r0289535 re3caaf5 4 4 2007/05/17 (thomasb) 5 5 ---------- 6 - Updated Catalan, Russian, and Chinese translations6 - Updated Catalan, Russian, Portuguese and Chinese translations 7 7 - Renamed localization folder for Chinese (Big5) 8 8 - Chanegd Slovenian language code from 'si' to 'sl' 9 - Added Sinhala (Sri-Lanka) localization 10 - Use global filters and bind username/ for Ldap searches (#1484159) 9 11 10 12 -
config/main.inc.php.dist
rf115416 re3caaf5 198 198 * 'port' => 389, 199 199 * 'base_dn' => '', 200 * 'bind_dn' => '', 201 * 'bind_pass' => '', 200 202 * 'search_fields' => array('mail', 'cn'), // fields to search in 201 203 * 'name_field' => 'cn', // this field represents the contact's name 202 204 * 'email_field' => 'mail', // this field represents the contact's e-mail 203 205 * 'scope' => 'sub', // search mode: sub|base|list 206 * 'filter' => '', // will be &'d with search field ex: (status=act) 204 207 * 'fuzzy_search' => true); // server allows wildcard search 205 208 */ -
program/include/rcube_ldap.inc
rf115416 re3caaf5 94 94 95 95 if (is_resource($this->conn)) 96 { 96 97 $this->ready = true; 98 if (!empty($this->prop['bind_dn']) && !empty($this->prop['bind_pass'])) 99 $this->ready = $this->bind($this->prop['bind_dn'], $this->prop['bind_pass']); 100 } 97 101 else 98 102 raise_error(array('type' => 'ldap', 'message' => "Could not connect to any LDAP server, tried $host:{$this->prop[port]} last"), true); … … 101 105 102 106 /** 103 * Merge with connect()? 104 */ 105 function bind($dn=null, $pass=null) 106 { 107 if ($this->conn) 108 { 109 if ($dn) 110 { 111 if (@ldap_bind($this->conn, $dn, $pass)) 112 return true; 113 else 114 raise_error(array('code' => ldap_errno($this->conn), 115 'type' => 'ldap', 116 'message' => "Bind failed for dn=$dn: ".ldap_error($this->conn)), 117 true); 118 } 119 else 120 { 121 if (@ldap_bind($this->conn)) 122 return true; 123 else 124 raise_error(array('code' => ldap_errno($this->conn), 125 'type' => 'ldap', 126 'message' => "Anonymous bind failed: ".ldap_error($this->conn)), 127 true); 128 } 129 } 107 * Bind connection with DN and password 108 */ 109 function bind($dn, $pass) 110 { 111 if (!$this->conn) 112 return false; 113 114 if (@ldap_bind($this->conn, $dn, $pass)) 115 return true; 130 116 else 131 raise_error(array('type' => 'ldap', 'message' => "Attempted bind on nonexistent connection"), true); 132 117 { 118 raise_error(array( 119 'code' => ldap_errno($this->conn), 120 'type' => 'ldap', 121 'message' => "Bind failed for dn=$dn: ".ldap_error($this->conn)), 122 true); 123 } 124 133 125 return false; 134 }126 } 135 127 136 128 … … 271 263 } 272 264 $filter .= ')'; 265 266 // add general filter to query 267 if (!empty($this->prop['filter'])) 268 $filter = '(&'.$this->prop['filter'] . $filter . ')'; 273 269 274 270 // set filter string and execute search … … 386 382 { 387 383 $function = $this->prop['scope'] == 'sub' ? 'ldap_search' : ($this->prop['scope'] == 'base' ? 'ldap_read' : 'ldap_list'); 388 $this->ldap_result = @$function($this->conn, $this->prop['base_dn'], $this->filter, array_values($this->fieldmap), 0, 0);384 $this->ldap_result = $function($this->conn, $this->prop['base_dn'], $this->filter, array_values($this->fieldmap), 0, 0); 389 385 return true; 390 386 }
Note: See TracChangeset
for help on using the changeset viewer.
