Автор Тема: roundcube ldap  (Прочитано 2440 раз)

Оффлайн zhhh

  • Завсегдатай
  • *
  • Сообщений: 56
roundcube ldap
« : 08.09.2016 23:16:46 »
Добрый вечер, Уважаемые!
p8: nginx, php5-fpm, roundcube
Хочу настроить Адресную книгу в roundcube, прописал запрос в конфиге, в результате валится ошибка:
[08-Sep-2016 21:21:50 Europe/Moscow] PHP Fatal error:  Class 'Net_LDAP3' not found in /usr/share/roundcube/program/lib/Roundcube/rcube_ldap_generic.php on line 31погуглил, вроде как нужен пакет pear-Net_LDAP3, но в репах его нет. Что делать?

Оффлайн ruslandh

  • Поспешай не торопясь !
  • Модератор глобальный
  • *****
  • Сообщений: 32 251
  • Учиться .... Телепатами не рождаются, ими ....
    • Email
Re: roundcube ldap
« Ответ #1 : 09.09.2016 05:11:22 »

Оффлайн zhhh

  • Завсегдатай
  • *
  • Сообщений: 56
Re: roundcube ldap
« Ответ #2 : 09.09.2016 10:19:09 »
Погуглил, решение следующее:
правим файл /usr/share/roundcube/config/composer.json
переносим строки из "suggest" в "require"
"pear-pear.php.net/net_ldap2": "~2.2.0 required for connecting to LDAP address books",
"kolab/Net_LDAP3": "dev-master required for connecting to LDAP address books"
качаем плагин Net_LDAP3
кладем файлы из архива в папку /usr/share/php/pear/Net
должно быть так:
/usr/share/php/pear/Net/LDAP3.php
/usr/share/php/pear/Net/Net_LDAP3/LDAP3/Result.php
чтоб настроить подключение к адресной книге LDAP добавим в конфиг /usr/share/roundcube/config/defaults.inc.php (это мой, возможно с лишними параметрами, но все показывает)
$config['ldap_public']['ldap'] = array(
  'name'          => 'site.ru',
  'hosts'         => array('localhost'),
  'port'          => 389,
  'use_tls'       => false,
  'ldap_version'  => 3,       // using LDAPv3
  'network_timeout' => 10,    // The timeout (in seconds) for connect + bind arrempts. This is only supported in PHP >= 5.3.0
  'user_specific' => false,   // If true the base_dn, bind_dn and bind_pass default to the user's IMAP login.
  'base_dn'       => 'ou=AddressBook,dc=site,dc=ru',
  'search_filter'  => '',   // e.g. '(&(objectClass=posixAccount)(uid=%u))'
  'fieldmap' => array(
    // Roundcube  => LDAP:limit
    'name'        => 'cn',
    'surname'     => 'sn',
    'firstname'   => 'givenName',
    'jobtitle'    => 'title',
    'email'       => 'mail:*',
    'phone:home'  => 'homePhone',
    'phone:work'  => 'telephoneNumber',
    'phone:mobile' => 'mobile',
    'phone:pager' => 'pager',
    'phone:workfax' => 'facsimileTelephoneNumber',
    'street'      => 'street',
    'zipcode'     => 'postalCode',
    'region'      => 'st',
    'locality'    => 'l',
    // if you country is a complex object, you need to configure 'sub_fields' below
    'country'      => 'c',
    'organization' => 'o',
    'department'   => 'ou',
    'jobtitle'     => 'title',
    'notes'        => 'description',
    'photo'        => 'jpegPhoto',
    // these currently don't work:
    // 'manager'       => 'manager',
    // 'assistant'     => 'secretary',
  ),
  'sort'           => 'cn',         // The field to sort the listing by.
  'scope'          => 'sub',        // search mode: sub|base|list
  'filter'         => '(objectClass=inetOrgPerson)',      // used for basic listing (if not empty) and will be &'d with search
  'fuzzy_search'   => true,         // server allows wildcard search
  'vlv'            => false,        // Enable Virtual List View to more efficiently fetch paginated data (if server supports i
  'vlv_search'     => false,        // Use Virtual List View functions for autocompletion searches (if server supports it)
  'numsub_filter'  => '(objectClass=organizationalUnit)',   // with VLV, we also use numSubOrdinates to query the total number
  'config_root_dn' => 'cn=config',  // Root DN to search config entries (e.g. vlv indexes)
  'sizelimit'      => '0',          // Enables you to limit the count of entries fetched. Setting this to 0 means no limit.
  'timelimit'      => '0',          // Sets the number of seconds how long is spend on the search. Setting this to 0 means no
  'referrals'      => false,        // Sets the LDAP_OPT_REFERRALS option. Mostly used in multi-domain Active Directory setups
  'dereference'    => 0,            // Sets the LDAP_OPT_DEREF option. One of: LDAP_DEREF_NEVER, LDAP_DEREF_SEARCHING, LDAP_DE
                                    // Used where addressbook contains aliases to objects elsewhere in the LDAP tree.

);

конечно же строка должна содержать ваши настройки'base_dn'       => 'ou=AddressBook,dc=site,dc=ru',
« Последнее редактирование: 09.09.2016 22:44:01 от zhhh »