Roundcube Community Forum

 

Display Name from LDAP

Started by Dmitry42, November 02, 2023, 01:34:48 PM

Previous topic - Next topic

Dmitry42

Hi!
It is possible to fill field Display Name in identities from LDAP ?
May be config options or another way ?

PS.
Now I just think -  I can write script who take Display Name from AD and post it to MariaDB users settings table, but I hope exist some better and easy way.

alec

Check new_user_identity plugin.

Dmitry42

Looks like that I want!
Thank you!

Dmitry42

im not clearly understand config file and need explanation:

1.
Quote// The id of the address book to use to automatically set a
// user's full name in their new identity. (This should be an
// string, which refers to the $config['ldap_public'] array.)
$config['new_user_identity_addressbook'] = 'ldap_users';

Here I must use my address book name from my RC config ?

2.
Quote// When automatically setting a user's full name in their
// new identity, match the user's login name against this field.
$config['new_user_identity_match'] = 'uid';

This I can't understand. For example I take from AD to my address book this fields:
'name'   => 'displayname',
'email'   => 'mail'

and for login my users use full mail like user@domain.com. Should I use 'email' ? $config['new_user_identity_match'] = 'email';
And what field from address book will be used for filling identities ?

3.
Quote// Determine whether to import user's identities on each login.
// New user identity will be created for each e-mail address
// present in address book, but not assigned to any identity.
$config['new_user_identity_onlogin'] = false;

If I set it to TRUE then users identities will be rewrite from LDAP every time when user login or what ?

Dmitry42

I setup like this:

Quote
$config['new_user_identity_addressbook'] = 'ldap_users';
$config['new_user_identity_match'] = 'email';
$config['new_user_identity_onlogin'] = true;

Quote$config['ldap_public'] = [
  'ldap_users' => [
                        ......................
                        'search_fields'         =>['displayname','mail'],
                        'fieldmap'              => [
                                                        'name'  => 'displayname',
                                                        'email' => 'mail'
                         ],
                        ......................
        ],

But stilll when I login - users identity not update from AD. Can't understand how I can debug this or what I do wrong ?


Dmitry42