[Register]
Powered by Elgg

Developer discussion :: Blog :: Not setting firstname, surname, and mail address when creating new users from ldap

May 07, 2008

In http://classic.elgg.org/trac/ticket/277 it was pointed out that the entries in auth/multiple/auth.ini for ldap_search_attr should be separate i.e.

ldap_search_attr[] = givenName
ldap_search_attr[] = sn
ldap_search_attr[] = mail

which after parse_ini_file does its work gives

             [ldap_search_attr] => Array
                (
                    [0] => givenName
                    [1] => sn
                    [2] => mail
                )

The next problem is that as the comment at the top of auth/ldap/lib.php says it should be

          $CFG->ldap_search_attr = array('firstname' => 'givenname',
                                         'lastname' => 'sn',
                                         'mail' => 'mail');

As the code later in the file uses

                $user->email = $user_info["mail"];
                $user->name  = $user_info["firstname"];
                $user->name  = $user->name . " " . $user_info["lastname"];

Since I want multiple ldap sources I want auth.ini to work but how to change it 0, 1, and 2 do not say what the attributes represent if all ldap sources use the same sn, mail, and givenName then I could uncomment the line at the top of the lib.php.

Interestingly most comments on how to do ldap still refer to putting the parameters directly into the config.php file.

 

Keywords: ldap authentication auth.ini

Posted by Kevin Murray @ Developer discussion

You must be logged in to post a comment.

Site supported by Curverider Ltd - powered by the awesome Elgg