wizardDetectorSimpleRequestAbstract.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /**
  2. * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
  3. * SPDX-FileCopyrightText: 2015 ownCloud, Inc.
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. OCA = OCA || {};
  7. (function() {
  8. /**
  9. * @classdesc a Port Detector. It executes the auto-detection of the port
  10. * by the Nextcloud server, if requirements are met.
  11. *
  12. * @constructor
  13. */
  14. var WizardDetectorFilterSimpleRequestAbstract = OCA.LDAP.Wizard.WizardDetectorGeneric.subClass({
  15. runsOnRequest: true,
  16. /**
  17. * runs the detector, if port is not set.
  18. *
  19. * @param {OCA.LDAP.Wizard.ConfigModel} model
  20. * @param {string} configID - the configuration prefix
  21. * @returns {boolean|jqXHR}
  22. * @abstract
  23. */
  24. run: function(model, configID) {
  25. if(_.isUndefined(this.wizardMethod)) {
  26. console.warn('wizardMethod not set! ' + this.constructor);
  27. return false;
  28. }
  29. model.notifyAboutDetectionStart(this.targetKey);
  30. var params = OC.buildQueryString({
  31. action: this.wizardMethod,
  32. ldap_serverconfig_chooser: configID
  33. });
  34. return model.callWizard(params, this.processResult, this);
  35. }
  36. });
  37. OCA.LDAP.Wizard.WizardDetectorFilterSimpleRequestAbstract = WizardDetectorFilterSimpleRequestAbstract;
  38. })();