wizardDetectorPort.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * Copyright (c) 2015, Arthur Schiwon <blizzz@owncloud.com>
  3. * This file is licensed under the Affero General Public License version 3 or later.
  4. * See the COPYING-README file.
  5. */
  6. OCA = OCA || {};
  7. (function() {
  8. /**
  9. * @classdesc a Port Detector. It executes the auto-detection of the port
  10. * by the ownCloud server, if requirements are met.
  11. *
  12. * @constructor
  13. */
  14. var WizardDetectorPort = OCA.LDAP.Wizard.WizardDetectorGeneric.subClass({
  15. /** @inheritdoc */
  16. init: function() {
  17. this.setTargetKey('ldap_port');
  18. this.runsOnRequest = true;
  19. },
  20. /**
  21. * runs the detector, if port is not set.
  22. *
  23. * @param {OCA.LDAP.Wizard.ConfigModel} model
  24. * @param {string} configID - the configuration prefix
  25. * @returns {boolean|jqXHR}
  26. * @abstract
  27. */
  28. run: function(model, configID) {
  29. model.notifyAboutDetectionStart('ldap_port');
  30. var params = OC.buildQueryString({
  31. action: 'guessPortAndTLS',
  32. ldap_serverconfig_chooser: configID
  33. });
  34. return model.callWizard(params, this.processResult, this);
  35. }
  36. });
  37. OCA.LDAP.Wizard.WizardDetectorPort = WizardDetectorPort;
  38. })();