Le 06/09/2018 à 16:01, Ralf Mattes a écrit :
>  
> Am Donnerstag, 06. September 2018 15:20 CEST, Clément OUDOT 
> <[email protected]> schrieb: 
>   
>> Good question. You can write some javascript that will search on
>> destination LDAP if the login already exists, and adapt it.
>>
>>
>> Code example:
>>
>> function getUid(dstLdap, firstname, lastname, employeeid) {
>>
>>     var uid = "";
>>     var uidTest = "";
>>
>>     firstname = normalizeString(firstname).toLowerCase();
>>     lastname = normalizeString(lastname).toLowerCase();
>>
>>
>>         for ( var i = 0; i < firstname.length(); i++ ){
>>              uidTest = lastname + firstname.substr(0,i+1);
>>              if (
>> dstLdap.search("ou=users","(&(!(employeeNumber="+employeeid+"))(uid="+uidTest+"))"
>> ) == "[]" ) {
>>                  uid = uidTest;
>>                  break;
>>              }
>>         }
>>
>>     return uid;
>> }
> Just to mention it: the above code does have a potential race condition. 
> Unlikely to happen, but
> needs to be aware of it.

If you launch LSC with only one thread (-t 1), you should not have race
condition on this code.


-- 
Clément Oudot | Identity Solutions Manager

[email protected]

Worteks | https://www.worteks.com

_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
[email protected]
https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users

Reply via email to