Changeset 4953 in subversion
- Timestamp:
- Jul 22, 2011 6:49:45 AM (22 months ago)
- File:
-
- 1 edited
-
trunk/plugins/acl/acl.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/acl/acl.php
r4950 r4953 86 86 $this->load_config(); 87 87 88 $search = get_input_value('_search', RCUBE_INPUT_GPC, true); 89 $uid_field = $this->rc->config->get('acl_users_uid_field', 'uid'); 90 $users = array(); 88 $search = get_input_value('_search', RCUBE_INPUT_GPC, true); 89 $users = array(); 91 90 92 91 if ($this->init_ldap()) { … … 95 94 96 95 foreach ($result->records as $record) { 97 $user = $record[ $uid_field];96 $user = $record['uid']; 98 97 99 98 if (is_array($user)) { … … 103 102 104 103 if ($user) { 105 106 104 if ($record['name']) 107 105 $user = $record['name'] . ' (' . $user . ')'; … … 182 180 $this->rc->output->set_env('acl_users_source', (bool) $this->rc->config->get('acl_users_source')); 183 181 $this->rc->output->set_env('mailbox', $mbox_imap); 184 $this->rc->output->add_label('searching');185 182 $this->rc->output->add_handlers(array( 186 183 'acltable' => array($this, 'templ_table'), … … 634 631 } 635 632 636 // search also in UID field 637 $ldap_config[$addressbook]['search_fields'] = array_unique( 638 array_merge((array)$uid_field, (array)$ldap_config[$addressbook]['search_fields'])); 639 640 // add UID field to fieldmap, so it will be returned in a record 641 if (isset($ldap_config[$addressbook]['fieldmap'])) { 642 if (empty($ldap_config[$addressbook]['fieldmap']['uid'])) { 643 $ldap_config[$addressbook]['fieldmap']['uid'] = $uid_field; 644 } 633 $ldap_config = $ldap_config[$addressbook]; 634 635 // get name attribute 636 if (!empty($ldap_config['fieldmap'])) { 637 $name_field = $ldap_config['fieldmap']['name_field']; 645 638 } 646 639 // ... no fieldmap, use the old method 647 else if (empty($ldap_config[$addressbook]['uid_field'])) { 648 $ldap_config[$addressbook]['uid_field'] = $uid_field; 649 } 640 if (empty($name_field)) { 641 $name_field = $ldap_config['name_field']; 642 } 643 644 // add UID field to fieldmap, so it will be returned in a record with name 645 $ldap_config['fieldmap'] = array( 646 'name' => $name_field, 647 'uid' => $uid_field, 648 ); 649 650 // search in UID and name fields 651 $ldap_config['search_fields'] = array_values($ldap_config['fieldmap']); 652 653 // disable vlv 654 $ldap_config['vlv'] = false; 650 655 651 656 // Initialize LDAP connection 652 $this->ldap = new rcube_ldap( 653 $ldap_config[$addressbook], 657 $this->ldap = new rcube_ldap($ldap_config, 654 658 $this->rc->config->get('ldap_debug'), 655 659 $this->rc->config->mail_domain($_SESSION['imap_host']));
Note: See TracChangeset
for help on using the changeset viewer.
