@3kles/3kles-ldap
Version:
59 lines (57 loc) • 2.63 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ADController = void 0;
var utils = require("./ldap.utils");
var ldap_controller_1 = require("./ldap.controller");
var ADController = /** @class */ (function (_super) {
__extends(ADController, _super);
function ADController() {
return _super !== null && _super.apply(this, arguments) || this;
}
ADController.prototype.parseResponse = function (response, type) {
if (this.parameters[type]) {
var param = this.parameters[type];
if (param.option.ad) {
switch (param.option.ad) {
case utils.LIST_USER: {
if (response.searchEntries) {
return response.searchEntries.filter(function (e) { return JSON.stringify(e.objectClass) === JSON.stringify(utils.userClass); });
}
break;
}
case utils.LIST_GROUP: {
if (response.searchEntries) {
return response.searchEntries.filter(function (e) { return JSON.stringify(e.objectClass) === JSON.stringify(utils.groupClass); });
}
break;
}
case utils.LIST_COMPUTER: {
if (response.searchEntries) {
return response.searchEntries.filter(function (e) { return JSON.stringify(e.objectClass) === JSON.stringify(utils.computerClass); });
}
break;
}
}
}
}
return response;
};
return ADController;
}(ldap_controller_1.LDAPController));
exports.ADController = ADController;
//# sourceMappingURL=ad.controller.js.map