diff --git a/ldapjs/index-b.js b/ldapjs/index-b.js index f2aa764..85b1cb4 100644 --- a/ldapjs/index-b.js +++ b/ldapjs/index-b.js @@ -1,4 +1,8 @@ -var ldapClient = ldap.createClient({url:'ldaps://srv-dc.vbn-gmbh.local:636'}, function (err){ +const ldap = require('ldapjs'); + +xvar ldapClient = ldap.createClient({ + url:'ldaps://srv-dc.vbn-gmbh.local:636' +}, function (err){ if (err) { console.log('Failed'); process.exit(1); diff --git a/ldapjs/index-c.js b/ldapjs/index-c.js index 9b335e8..943ac01 100644 --- a/ldapjs/index-c.js +++ b/ldapjs/index-c.js @@ -1,3 +1,5 @@ +const ldap = require('ldapjs'); + var ldapClient = ldap.createClient({url:'ldaps://srv-dc.vbn-gmbh.local:636'}, function (err){ if (err) { console.log('Failed'); diff --git a/ldapjs/index-d.js b/ldapjs/index-d.js index 6fa8baf..3f63b08 100644 --- a/ldapjs/index-d.js +++ b/ldapjs/index-d.js @@ -11,7 +11,7 @@ client.on('connectError', (err) => { client.bind('cn=Begerad\, Stefan', 'secret', (err) => { assert.ifError(err); - console.error('Error?!'); + console.error('Bind error?!'); }); const opts = { @@ -39,3 +39,8 @@ client.search('o=example', opts, (err, res) => { console.log('status: ' + result.status); }); }); + +client.unbind((err) => { + assert.ifError(err); + console.error('Unbind error?!'); +});