Hi

I am trying to sync the nsAccountLock from my 389DS to AD. I have a
forceValues section for the userAccountControl attribute:

...
        <defaultPolicy>FORCE</defaultPolicy>
...

        <dataset>
          <name>userAccountControl</name>

          <forceValues>
            <string><![CDATA[js:

var uac =  dstBean.getDatasetFirstValueById('userAccountControl');

// Desactivación de la cuenta
if ( ( srcBean.getDatasetFirstValueById("nsAccountLock") != null ) &&
( srcBean.getDatasetFirstValueById("nsAccountLock").equalsIgnoreCase("true")
) ) {
  // Comprobar y desactivar cuenta
  if ( ! AD.userAccountControlCheck (uac, AD.UAC_ACCOUNTDISABLE) ) {
    uac = AD.userAccountControlSet( uac, [AD.UAC_SET_ACCOUNTDISABLE] );
  }
}
else {
  // Comprobar y activar cuenta
  if ( AD.userAccountControlCheck (uac, AD.UAC_ACCOUNTDISABLE) ) {
    uac = AD.userAccountControlSet( uac, [AD.UAC_UNSET_ACCOUNTDISABLE] );
  }
}

// Devolver el valor modificado del atributo
uac;

            ]]></string>
          </forceValues>
        </dataset>


But when a entry is going to be created, I get an exception because
dstBean is not defined:

oct 25 10:41:14 - ERROR - javax.script.ScriptException:
sun.org.mozilla.javascript.internal.EcmaError: ReferenceError:
"dstBean" is not defined. (<Unknown source>#5) in <Unknown source> at
line number 5

I can create a createValues section that haven't a reference to
dstBean, but when a entry is created, the forceValues code is also
executed, and I get the error. How can I do this?

Regards and thanks in advance.
_______________________________________________________________
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