Thank you very much Clement,
I still had a problem which took me a full day to understand
because I am not a developper and didn't know how to debug the script
in fact the test always returned TRUE because I made the match test on an
attribute that was not fetched !!! Yes it is silly, but I am only a
sysadmin :)
now I used this for debug :
and eventually work like a charm
In the ldap source definition
<fetchedAttributes>
<string>entryDN</string>
...
<![CDATA[
var result = true;
var dne =
srcBean.getDatasetFirstValueById("entryDN");
println("******************************************** " + dne + "
######################");
var regexp = /ou=projets/i;
if (dne.match(regexp)) { result = false;}
println("RESUUUUUUUULRT " + result + "
!!!!");
result;
]]>
P.S.
Could you please enlight me on the use of pivot attribute, do they must
match between source and destination ? What are they used for ?
Best regards.
Franck
From: "EXTERN [email protected]"
<[email protected]>
To: [email protected],
Date: 19/10/2016 10:36
Subject: Re: [lsc-users] Ldap scope settings
Le 19/10/2016 à 08:11, [email protected] a écrit :
__________________
Ok but I a do not understand how to write this condition
<propertiesBasedSyncOptions>
<mainIdentifier>js: "CN=" +
capitalize(srcBean.getDatasetFirstValueById("cn")) +
",OU=INTERNE,OU=UserAccounts,DC=DOMAIN,DC=my"</mainIdentifier>
<defaultDelimiter>;</defaultDelimiter>
<defaultPolicy>FORCE</defaultPolicy>
<conditions>
<create>true</create>
<update>true</update>
<delete>true</delete>
<changeId>true</changeId>
</conditions>
I suppose I should replace the value which is TRUE to a test, it would be
kind if you could show me an example
For example:
<create>
<![CDATA[
var result = true;
var dn = srcBean.getDatasetFirstValueById("entryDN");
var regexp = /ou=projects/i;
if ( dn.match(regexp) ) { result = false; }
result;
]]>
</create>
Be sure to add entryDN in source fetchedAttributes to be able to use its
value in the test.
--
Clément OUDOT
Consultant en logiciels libres, Expert infrastructure et sécurité
Savoir-faire Linux
137 boulevard de Magenta - 75008 PARIS
Blog: http://sflx.ca/coudot
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org
lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users