Changeset 702 for trunk/forum/includes/auth/auth_ldap.php
- Timestamp:
- Mar 31, 2010, 6:32:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/forum/includes/auth/auth_ldap.php
r400 r702 7 7 * 8 8 * @package login 9 * @version $Id : auth_ldap.php 8479 2008-03-29 00:22:48Z naderman$9 * @version $Id$ 10 10 * @copyright (c) 2005 phpBB Group 11 11 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 64 64 $search = @ldap_search( 65 65 $ldap, 66 $config['ldap_base_dn'],66 htmlspecialchars_decode($config['ldap_base_dn']), 67 67 ldap_user_filter($user->data['username']), 68 (empty($config['ldap_email'])) ? array($config['ldap_uid']) : array($config['ldap_uid'], $config['ldap_email']), 68 (empty($config['ldap_email'])) ? 69 array(htmlspecialchars_decode($config['ldap_uid'])) : 70 array(htmlspecialchars_decode($config['ldap_uid']), htmlspecialchars_decode($config['ldap_email'])), 69 71 0, 70 72 1 … … 86 88 } 87 89 88 if (!empty($config['ldap_email']) && !isset($result[0][ $config['ldap_email']]))90 if (!empty($config['ldap_email']) && !isset($result[0][htmlspecialchars_decode($config['ldap_email'])])) 89 91 { 90 92 return $user->lang['LDAP_NO_EMAIL']; … … 153 155 if ($config['ldap_user'] || $config['ldap_password']) 154 156 { 155 if (!@ldap_bind($ldap, $config['ldap_user'], htmlspecialchars_decode($config['ldap_password'])))157 if (!@ldap_bind($ldap, htmlspecialchars_decode($config['ldap_user']), htmlspecialchars_decode($config['ldap_password']))) 156 158 { 157 159 return $user->lang['LDAP_NO_SERVER_CONNECTION']; … … 161 163 $search = @ldap_search( 162 164 $ldap, 163 $config['ldap_base_dn'],165 htmlspecialchars_decode($config['ldap_base_dn']), 164 166 ldap_user_filter($username), 165 (empty($config['ldap_email'])) ? array($config['ldap_uid']) : array($config['ldap_uid'], $config['ldap_email']), 167 (empty($config['ldap_email'])) ? 168 array(htmlspecialchars_decode($config['ldap_uid'])) : 169 array(htmlspecialchars_decode($config['ldap_uid']), htmlspecialchars_decode($config['ldap_email'])), 166 170 0, 167 171 1 … … 224 228 'username' => $username, 225 229 'user_password' => phpbb_hash($password), 226 'user_email' => (!empty($config['ldap_email'])) ? $ldap_result[0][$config['ldap_email']][0]: '',230 'user_email' => (!empty($config['ldap_email'])) ? utf8_htmlspecialchars($ldap_result[0][htmlspecialchars_decode($config['ldap_email'])][0]) : '', 227 231 'group_id' => (int) $row['group_id'], 228 232 'user_type' => USER_NORMAL, 229 233 'user_ip' => $user->ip, 234 'user_new' => ($config['new_member_post_limit']) ? 1 : 0, 230 235 ); 231 236 … … 277 282 if ($config['ldap_user_filter']) 278 283 { 279 $filter = "(&$filter({$config['ldap_user_filter']}))"; 284 $_filter = ($config['ldap_user_filter'][0] == '(' && substr($config['ldap_user_filter'], -1) == ')') ? $config['ldap_user_filter'] : "({$config['ldap_user_filter']})"; 285 $filter = "(&{$filter}{$_filter})"; 280 286 } 281 287 return $filter;
Note:
See TracChangeset
for help on using the changeset viewer.