How to use the ldapjs.OrFilter function in ldapjs

To help you get started, we’ve selected a few ldapjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PhilWaldmann / openrecord / lib / stores / ldap / helper.js View on Github external
continue;
      }
      
      
      //subString
      if(operator === 'like'){
        var or = []
        for(var v = 0; v < value.length; v++){
          or.push(new ldap.SubstringFilter({
            attribute: name,
            any: [value[v]]
          }))
        }
        
        if(or.length > 0){
          tmp.addFilter(new ldap.OrFilter({filters: or}));
        }
        
        continue;
      }
      
    }else{
      var query = conditions[i].query;
      var args = conditions[i].args;
      //TODO: put args into query
      
      var custom = ldap.parseFilter(query);
      
      if(conditions.length === 1){
        operator.filter = custom;
      }else{
        tmp.addFilter(custom);
github PhilWaldmann / openrecord / lib / stores / ldap / data_types / _operators.js View on Github external
function(attr, value, options) {
        options.filter.filters.push(
          new ldap.OrFilter({
            filters: [
              new ldap.LessThanEqualsFilter({
                attribute: attr,
                value: value.toString()
              }),
              new ldap.NotPresenceFilter({ attribute: attr })
            ]
          })
        )
      },
      {
github PhilWaldmann / openrecord / lib / stores / ldap / helper.js View on Github external
if(BASIC_FILTERS[operator]){
                
        var or = []
        for(var v = 0; v < value.length; v++){
          or.push(new BASIC_FILTERS[operator]({
            attribute: name,
            value: value[v] ? value[v].toString() : null,
            original: value[v]
          }))
        }
        
        if(or.length > 0){
          filter = or[0];
          
          if(or.length > 1){
            filter = new ldap.OrFilter({filters: or});
          }
          
          if(NOT_OPERATORS.indexOf(operator) != -1){
            filter = new ldap.NotFilter({filter:filter});
          }
          tmp.addFilter(filter);
        }
        
        continue;
      }
      
      
      //subString
      if(operator === 'like'){
        var or = []
        for(var v = 0; v < value.length; v++){