123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- /**
- * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
- * SPDX-FileCopyrightText: 2015 ownCloud, Inc.
- * SPDX-License-Identifier: AGPL-3.0-or-later
- */
- OCA = OCA || {};
- (function() {
- /**
- * @classdesc a Base DN Detector. It executes the auto-detection of the base
- * DN by the Nextcloud server, if requirements are met.
- *
- * @constructor
- */
- var WizardDetectorBaseDN = OCA.LDAP.Wizard.WizardDetectorGeneric.subClass({
- /** @inheritdoc */
- init: function() {
- this.setTargetKey('ldap_base');
- this.runsOnRequest = true;
- },
- /**
- * runs the detector, if specified configuration settings are set and
- * base DN is not set.
- *
- * @param {OCA.LDAP.Wizard.ConfigModel} model
- * @param {string} configID - the configuration prefix
- * @returns {boolean|jqXHR}
- * @abstract
- */
- run: function(model, configID) {
- if( !model.configuration['ldap_host']
- || !model.configuration['ldap_port']
- )
- {
- return false;
- }
- model.notifyAboutDetectionStart(this.getTargetKey());
- var params = OC.buildQueryString({
- action: 'guessBaseDN',
- ldap_serverconfig_chooser: configID
- });
- return model.callWizard(params, this.processResult, this);
- }
- });
- OCA.LDAP.Wizard.WizardDetectorBaseDN = WizardDetectorBaseDN;
- })();
|