Author Topic: Can not set default identity with new_user_identity  (Read 2204 times)

Offline kazimk

  • Newbie
  • *
  • Posts: 7
Can not set default identity with new_user_identity
« on: June 06, 2020, 07:59:36 AM »
Hello,

I installed roundcube 1.4.5 and configured address book to get data from OpenLDAP but I could not achieve to get default identity from ldap. It always set it to username. Any help appretiated.



My configuration is like below.
$config['plugins'] = array('debug_logger', 'new_user_identity', 'archive', 'attachment_reminder', 'filesystem_attachments', 'jqueryui', 'markasjunk', 'newmail_notifier', 'password', 'zipdownload');

//new_user_identity.inc.php
$config['new_user_identity_addressbook'] = 'People';
$config['new_user_identity_match'] = 'uid';
$config['new_user_identity_onlogin'] = true;


$config['ldap_public']['People'] = array(
    'name'              => 'People',
    'hosts'             => array('localhost'),
    'port'              => 389,
    'user_specific'     => false,
    'base_dn'           => 'ou=org,dc=univ,dc=edu',
    'bind_dn'           => 'uid=user1,ou=org,dc=univ,dc=edu',
    'bind_pass'         => 'xxx',
    'search_only' => true,
    'hidden' => true,
    'writable' => false,
    'filter'            => '(objectClass=inetOrgPerson)',
        'search_fields'   => array('uid', 'givenName', 'cn', 'sn'),  // fields to search in
    'fieldmap' => array(
       // Roundcube   => LDAP
    'name'         => 'cn',
    'surname'      => 'sn',
    'firstname'    => 'givenName',
 ),
    'scope'          => 'sub',
);



Regards.
« Last Edit: June 06, 2020, 08:04:15 AM by kazimk »

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: Can not set default identity with new_user_identity
« Reply #1 on: June 07, 2020, 01:44:10 AM »
I'm not sure what do you mean by " It always set it to username". I think you might need to add 'email' and 'uid' fields to fieldmap.

Offline kazimk

  • Newbie
  • *
  • Posts: 7
Re: Can not set default identity with new_user_identity
« Reply #2 on: June 07, 2020, 03:35:45 AM »
Hello,

Thanks for your answer. I only added field below since we do not have mail attribute in our LDAP but result does not change. We also use username without domain as login name in roundcube. Our users default identity became "username <username@domain>". I can make search in address book from roundcube interface so LDAP address book setting works.  I want to set it Full Name instead of username.

'username'    => 'uid',

Regards.
« Last Edit: June 07, 2020, 10:53:48 AM by kazimk »

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: Can not set default identity with new_user_identity
« Reply #3 on: June 07, 2020, 09:48:24 AM »
$config['new_user_identity_match'] = 'uid'; -- this is the field name, i.e. the left-side in fieldmap.

Offline kazimk

  • Newbie
  • *
  • Posts: 7
Re: Can not set default identity with new_user_identity
« Reply #4 on: June 07, 2020, 11:00:29 AM »
Hello,

I tried two combination in fieldmap, the result is same.

'uid'    => 'email',

and

'email'    => 'uid',
« Last Edit: June 07, 2020, 02:09:37 PM by kazimk »

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: Can not set default identity with new_user_identity
« Reply #5 on: June 07, 2020, 02:12:31 PM »
Did you try 'uid' => 'uid' as I suggested?

Offline kazimk

  • Newbie
  • *
  • Posts: 7
Re: Can not set default identity with new_user_identity
« Reply #6 on: June 07, 2020, 02:29:00 PM »
I tried . Default identity still  like "username <username@domain>".

Offline kazimk

  • Newbie
  • *
  • Posts: 7
Re: Can not set default identity with new_user_identity
« Reply #7 on: June 08, 2020, 11:28:26 AM »
I solved issue with reimport mysql.initial.sql file. Now it seem correct. Thanks everybody.