Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

compare_response.js 754B

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
  2. var assert = require('assert-plus');
  3. var util = require('util');
  4. var LDAPResult = require('./result');
  5. var Protocol = require('../protocol');
  6. ///--- API
  7. function CompareResponse(options) {
  8. options = options || {};
  9. assert.object(options);
  10. options.protocolOp = Protocol.LDAP_REP_COMPARE;
  11. LDAPResult.call(this, options);
  12. }
  13. util.inherits(CompareResponse, LDAPResult);
  14. CompareResponse.prototype.end = function (matches) {
  15. var status = 0x06;
  16. if (typeof (matches) === 'boolean') {
  17. if (!matches)
  18. status = 0x05; // Compare false
  19. } else {
  20. status = matches;
  21. }
  22. return LDAPResult.prototype.end.call(this, status);
  23. };
  24. ///--- Exports
  25. module.exports = CompareResponse;