Hi, 

 
 
I had to use different parentheses :

 
js:String(Math.floor((Math.random() * 10000) + 1000)) 

 
but this indeed seems to work. Thank you for suggesting it! 

 
 
Met Vriendelijke Groet,
Kind Regards,
Salutations,
 
 
Bart Coninckx
Bits 'n Tricks BVBA
 
Hoge Mierdse Heide 182
2360 Oud-Turnhout
tel. +32 14 480 820

gsm +32 478 88 33 08
[email protected]
http://www.bitsandtricks.com
BTW: BE0817.401.875

Crelan BE46 8601 0806 3436

Voor onze Algemene Voorwaarden, zie: 
http://www.bitsandtricks.com/index.php/contact/algemene-voorwaarden

 

 
-----Original message-----
From:Jon C Kidder <[email protected]>
Sent:Thu 05-01-2017 13:36
Subject:Re: [lsc-users] [EXTERNAL] Re: generate a random value for uidNumber
To:General discussions and help for Ldap Synchronization Connector(LSC) - Start 
here! <[email protected]>; 
 
Force the conversion to string using String().  My uidNumber generator looks 
like the line below and works just fine for me.

 

 
 

var tmpUidNumber = String(Math.floor(Math.random() * 9990000) + 10001)

 

 
 

-Jon C. Kidder

 

American Electric Power

 

Middleware Services

 

Email: [email protected] <mailto:[email protected]> 

 

Phone: 614-716-4970

 

 
 
From: [email protected] 
[mailto:[email protected]] On Behalf Of Bart Coninckx
 Sent: Thursday, January 05, 2017 7:23 AM
 To: [email protected]
 Subject: [EXTERNAL] Re: [lsc-users] generate a random value for uidNumber

 

 
 
 This is an EXTERNAL email. STOP. THINK before you CLICK links or OPEN 
attachments.

 
 
--------------------------------
 
 

Hi,

 

 
 

I'm afraid this might not help, because when I hardcode a value for uidNumber 
(say 1234), the result in the LSC output is:

 

 
 

1234.0

 

 
 

When I use quotes ( "1234"), the value is respected.

 

 
 

so it seems numbers are always suffixed with ".0". Is this a bug?

 

 
 

Thanks!

 

 
 

 
 

Met Vriendelijke Groet,
 Kind Regards,
 Salutations,
  
  
 Bart Coninckx
 Bits 'n Tricks BVBA
  
 Hoge Mierdse Heide 182
 2360 Oud-Turnhout
 tel. +32 14 480 820

 

gsm +32 478 88 33 08
 [email protected] <mailto:[email protected]> 
 http://www.bitsandtricks.com <http://www.bitsandtricks.com> 
 BTW: BE0817.401.875

 

Crelan BE46 8601 0806 3436

 

Voor onze Algemene Voorwaarden, zie: 
http://www.bitsandtricks.com/index.php/contact/algemene-voorwaarden 
<http://www.bitsandtricks.com/index.php/contact/algemene-voorwaarden> 

 

 
 


  

 

-----Original message-----
 From: Sébastien Bahloul <[email protected] 
<mailto:[email protected]> >
 Sent: Thu 05-01-2017 13:08
 Subject: Re: [lsc-users] generate a random value for uidNumber
 To: General discussions and help for Ldap Synchronization Connector (LSC) - 
Start here! <[email protected] 
<mailto:[email protected]> >; 

 

I would advise you to try and convert it to an integer: 
http://stackoverflow.com/questions/596467/how-do-i-convert-a-float-number-to-a-whole-number-in-javascript
 
<http://stackoverflow.com/questions/596467/how-do-i-convert-a-float-number-to-a-whole-number-in-javascript>
 

 

 
 

Regards,

 


 

 
Sebastien BAHLOUL

 

 
 

2017-01-05 12:28 GMT+01:00 Bart Coninckx <[email protected] 
<mailto:[email protected]> >:

 

Hi,

 

 
 

thank you. I actually like the random creation of uidNumber with Javascript. Is 
there any way to have to output to that formatted without the ".0" ?

 

 
 

Thx!

 

 
 

 
 

Met Vriendelijke Groet,
 Kind Regards,
 Salutations,
  
  
 Bart Coninckx
 Bits 'n Tricks BVBA
  
 Hoge Mierdse Heide 182
 2360 Oud-Turnhout
 tel. +32 14 480 820

 

gsm +32 478 88 33 08
 [email protected] <mailto:[email protected]> 
 http://www.bitsandtricks.com <http://www.bitsandtricks.com> 
 BTW: BE0817.401.875

 

Crelan BE46 8601 0806 3436

 

Voor onze Algemene Voorwaarden, zie: 
http://www.bitsandtricks.com/index.php/contact/algemene-voorwaarden 
<http://www.bitsandtricks.com/index.php/contact/algemene-voorwaarden> 

 

 
 


  

 

-----Original message-----
 From: Sébastien Bahloul <[email protected] 
<mailto:[email protected]> >
 Sent: Thu 05-01-2017 11:59
 Subject: Re: [lsc-users] generate a random value for uidNumber

 
To: General discussions and help for Ldap Synchronization Connector (LSC) - 
Start here! <[email protected] 
<mailto:[email protected]> >; 

 

Hi Bart,

 

 
 

You could also have a look to the following page which provides a way to manage 
a replayable identifier based on a LDAP entry :

 

 
 

http://lsc-project.org/wiki/documentation/latest/configuration/syncoptions/sequences
 
<http://lsc-project.org/wiki/documentation/latest/configuration/syncoptions/sequences>
 

 

 
 

Otherwise, each synchronization may reattribute these identifiers.

 

 
 

Regards,

 


 

 
Sebastien BAHLOUL

 

 
 

2017-01-03 22:10 GMT+01:00 Bart Coninckx <[email protected] 
<mailto:[email protected]> >:

 

Hi all,

 

 
 

I am syncing from LDAP to eDirectory with lsc-2.1.3. In the target directory I 
need to add a objectclass which requires the uidNumber property. It is my 
assumption that this value should be unique per directory entry. Ideally a 
random value should be produced in between, let's say, 10000 and 20000. I'm not 
sure how to go about this. From what I read one solution would be to use 
scripting and have Javascript take care of this. I'm not very proficient at 
Javascript, are other scripting languages or bash supported?

 

 
 

Cheers,

 

 
 

Met Vriendelijke Groet,
 Kind Regards,
 Salutations,
  
  
 Bart Coninckx
 Bits 'n Tricks BVBA
  
 Hoge Mierdse Heide 182
 2360 Oud-Turnhout
 tel. +32 14 480 820

 

gsm +32 478 88 33 08
 [email protected] <mailto:[email protected]> 
 http://www.bitsandtricks.com <http://www.bitsandtricks.com> 
 BTW: BE0817.401.875

 

Crelan BE46 8601 0806 3436

 

Voor onze Algemene Voorwaarden, zie: 
http://www.bitsandtricks.com/index.php/contact/algemene-voorwaarden 
<http://www.bitsandtricks.com/index.php/contact/algemene-voorwaarden> 

 

 
 


 _______________________________________________________________
 Ldap Synchronization Connector (LSC) - http://lsc-project.org 
<http://lsc-project.org> 
 
 lsc-users mailing list
 [email protected] <mailto:[email protected]> 
 http://lists.lsc-project.org/listinfo/lsc-users 
<http://lists.lsc-project.org/listinfo/lsc-users> 

 


 

 


_______________________________________________________________
 Ldap Synchronization Connector (LSC) - http://lsc-project.org 
<http://lsc-project.org> 
 
 lsc-users mailing list
 [email protected] <mailto:[email protected]> 
 http://lists.lsc-project.org/listinfo/lsc-users 
<http://lists.lsc-project.org/listinfo/lsc-users> 

 
 


 _______________________________________________________________
 Ldap Synchronization Connector (LSC) - http://lsc-project.org 
<http://lsc-project.org> 
 
 lsc-users mailing list
 [email protected] <mailto:[email protected]> 
 http://lists.lsc-project.org/listinfo/lsc-users 
<http://lists.lsc-project.org/listinfo/lsc-users> 

 


 

 


_______________________________________________________________
 Ldap Synchronization Connector (LSC) - http://lsc-project.org 
<http://lsc-project.org> 
 
 lsc-users mailing list
 [email protected] <mailto:[email protected]> 
 http://lists.lsc-project.org/listinfo/lsc-users 
<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

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

lsc-users mailing list
[email protected]
http://lists.lsc-project.org/listinfo/lsc-users

Reply via email to