Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-ldap2json

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ldap2json - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

20

lib/functions.js

@@ -38,16 +38,22 @@ var ldap = require('ldapjs')

items.forEach(function(itm){
var o= new Object();
o.path=itm.distinguishedName;
o.hide=(itm.showInAdvancedViewOnly=="TRUE") ? true : false;
if (itm.objectClass.indexOf('organizationalUnit')>-1){
var o={};
o.type='OU';
o.name=itm.ou;
o.path=itm.distinguishedName;
retitems.push(o);
}
if (itm.objectClass.indexOf('person')>-1){
var o={};
} else if (itm.objectClass.indexOf('person')>-1){
o.type='USER';
o.name=itm.cn;
o.path=itm.distinguishedName;
retitems.push(o);
}
} else if(itm.objectClass.indexOf('container')>-1){
o.type='CN';
o.name=itm.cn;
retitems.push(o);
} else if(itm.objectClass.indexOf('group')>-1){
o.type='GROUP';
o.name=itm.cn;
retitems.push(o);
} else console.log(itm.cn+'--'+itm.objectClass);
count--;

@@ -54,0 +60,0 @@ if (count<=0){

@@ -8,7 +8,23 @@ var

var fillChilds=function(itm,options,cr,cb){
if (itm.hide){
cb(null);
return;
}
var newSearchOptions= extend({},options);
var searchChild=true;
if (itm.type=="OU"){
newSearchOptions.base='ou='+itm.name+','+options.base;
if(itm.type=="OU"){
newSearchOptions.base='ou='+itm.name+','+options.base;
} else if (itm.type=="CN") {
newSearchOptions.base='cn='+itm.name+','+options.base;
} else {
searchChild=false;
}
if (searchChild){
cr.getJson(newSearchOptions,function(e,t){
if (e){
console.log(e);
console.log(newSearchOptions);
}
if (t.items.length>0){

@@ -21,4 +37,3 @@ itm.haschilds=true;

cb(itm);
});
});
} else {

@@ -42,3 +57,3 @@ itm.haschilds=false;

var count=items.length;
if (count==0){
if (count==0) {
cb(null,me);

@@ -48,3 +63,5 @@ } else {

fillChilds(itm,options,recfunc,function(obj){
me.items.push(obj);
if (me!=null){
me.items.push(obj);
}
count--;

@@ -51,0 +68,0 @@ if(count<=0){

{
"name": "node-ldap2json",
"version": "0.0.2",
"version": "0.0.3",
"description": "LDAP2JSON makes a json return from LDAP Tree",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc