Cfscript & ldap

How can I use the ldap features in cfscript within Lucee? The
documentation http://docs.lucee.org/reference/tags/ldap.html states that
it is supported in cfscript but when I do
var l = new ldap();
I get an error: invalid component definition, can’t find component [ldap]

If I call a tag-based UDF that wraps the cfldap tag then I am able to get
the ldap query to run. This all with the Lucee server built-in to
CommandBox.

Thanks!
Wes

This does not work:

var l = new ldap(); // ← problem here
l.setServer(ldapServer);
l.setPort(ldapPort);
l.setUsername(ldapUsername);
l.setPassword(ldapPassword);

var qryResult = l.query(attributes=ldapAttr, start=ldapRoot, scope=ldapScope, filter=ldapFilter);

My current workaround:

SomeScript.cfc

var qryResult = UtilsCFML.MyLdapQuery(ldapServer, ldapPort, ldapUsername, ldapPassword, ldapAttr, ldapRoot, ldapScope, ldapFilter);

UtilsCFML.cfc

Try simply removing with ;

ldap server=ldapServer port=ldapPort username=ldapUsername password=ldapPassword name="results" start=ldapStart filter=ldapFilter attributes=ldapAttributes scope=ldapScope; On 10 March 2016 at 18:27, Wesley Hampton <@Wesley_Hampton> wrote: > How can I use the ldap features in cfscript within Lucee?

Ah, ok. Thank you for that explanation!

WesOn Thursday, March 10, 2016 at 3:16:13 PM UTC-5, Igal wrote:

is this just the way that tags translate to cfscript, or just certain ones
like ldap?

Most tags will translate this way. There are a few exceptions though, for
example, Dump will be used as a function, i.e. dump(var: x, label: “X”);

When the tag has a body then you would wrap the body with { braces }, and
if you need to output text into the body you would use writeOutput() or
echo() inside, for example,

will become:  

savecontent variable=“contents” {

dump(x);    // the dump of x will be now in the variable contents

}

Igal Sapir
Lucee Core Developer
Lucee.org http://lucee.org/
On 3/10/2016 12:09 PM, Wesley Hampton wrote:

Wow, okaaaay…that worked! Looks peculiar but since I’m new to Lucee is
this just the way that tags translate to cfscript, or just certain ones
like ldap?

Thanks a lot – learned something new here today…very puzzled…but did
learn :slight_smile:

Wes

On Thursday, March 10, 2016 at 2:21:12 PM UTC-5, Julian Halliwell wrote:

Try simply removing with ;

ldap server=ldapServer port=ldapPort username=ldapUsername password=ldapPassword name="results" start=ldapStart filter=ldapFilter attributes=ldapAttributes scope=ldapScope;

On 10 March 2016 at 18:27, Wesley Hampton wpha...@gmail.com wrote:

How can I use the ldap features in cfscript within Lucee?


Love Lucee? Become a supporter and be part of the Lucee project today! -
http://lucee.org/supporters/become-a-supporter.html

You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+un...@googlegroups.com <javascript:>.
To post to this group, send email to lu...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/4bcc8b21-77d0-4054-93a1-709909336614%40googlegroups.com?utm_medium=email&utm_source=footer
https://groups.google.com/d/msgid/lucee/4bcc8b21-77d0-4054-93a1-709909336614%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.

is this just the way that tags translate to cfscript, or just certain
ones like ldap?
Most tags will translate this way. There are a few exceptions though,
for example, Dump will be used as a function, i.e. dump(var: x, label: “X”);

When the tag has a body then you would wrap the body with { braces },
and if you need to output text into the body you would use writeOutput()
or echo() inside, for example,

 will become:

savecontent variable=“contents” {

 dump(x);    // the dump of x will be now in the variable contents

}

Igal Sapir
Lucee Core Developer
Lucee.org http://lucee.org/On 3/10/2016 12:09 PM, Wesley Hampton wrote:

Wow, okaaaay…that worked! Looks peculiar but since I’m new to Lucee
is this just the way that tags translate to cfscript, or just certain
ones like ldap?

Thanks a lot – learned something new here today…very puzzled…but
did learn :slight_smile:

Wes

On Thursday, March 10, 2016 at 2:21:12 PM UTC-5, Julian Halliwell wrote:

Try simply removing <cf and replacing > with ;

<cfscript>
ldap
  server=ldapServer
  port=ldapPort
  username=ldapUsername
  password=ldapPassword
  name="results"
  start=ldapStart
  filter=ldapFilter
  attributes=ldapAttributes
  scope=ldapScope;
</cfscript>

On 10 March 2016 at 18:27, Wesley Hampton <wpha...@gmail.com <javascript:>> wrote:
> How can I use the ldap features in cfscript within Lucee?


Love Lucee? Become a supporter and be part of the Lucee project today!


You received this message because you are subscribed to the Google
Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to lucee+unsubscribe@googlegroups.com
mailto:lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com
mailto:lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/4bcc8b21-77d0-4054-93a1-709909336614%40googlegroups.com
https://groups.google.com/d/msgid/lucee/4bcc8b21-77d0-4054-93a1-709909336614%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout.