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.

unbind_request.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Copyright 2011 Mark Cavage, Inc. All rights reserved.
  2. var assert = require('assert-plus');
  3. var util = require('util');
  4. var LDAPMessage = require('./message');
  5. var dn = require('../dn');
  6. var Protocol = require('../protocol');
  7. ///--- Globals
  8. var DN = dn.DN;
  9. var RDN = dn.RDN;
  10. ///--- API
  11. function UnbindRequest(options) {
  12. options = options || {};
  13. assert.object(options);
  14. options.protocolOp = Protocol.LDAP_REQ_UNBIND;
  15. LDAPMessage.call(this, options);
  16. }
  17. util.inherits(UnbindRequest, LDAPMessage);
  18. Object.defineProperties(UnbindRequest.prototype, {
  19. type: {
  20. get: function getType() { return 'UnbindRequest'; },
  21. configurable: false
  22. },
  23. _dn: {
  24. get: function getDN() {
  25. if (this.connection) {
  26. return this.connection.ldap.bindDN;
  27. } else {
  28. return new DN([new RDN({cn: 'anonymous'})]);
  29. }
  30. },
  31. configurable: false
  32. }
  33. });
  34. UnbindRequest.prototype._parse = function (ber) {
  35. assert.ok(ber);
  36. return true;
  37. };
  38. UnbindRequest.prototype._toBer = function (ber) {
  39. assert.ok(ber);
  40. return ber;
  41. };
  42. UnbindRequest.prototype._json = function (j) {
  43. assert.ok(j);
  44. return j;
  45. };
  46. ///--- Exports
  47. module.exports = UnbindRequest;