wizardDetectorEmailAttribute.js 830 B

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * SPDX-FileCopyrightText: 2015 ownCloud, Inc.
  3. * SPDX-License-Identifier: AGPL-3.0-or-later
  4. */
  5. OCA = OCA || {};
  6. (function() {
  7. /**
  8. * @classdesc let's the wizard backend count the available users
  9. *
  10. * @constructor
  11. */
  12. var WizardDetectorEmailAttribute = OCA.LDAP.Wizard.WizardDetectorFilterSimpleRequestAbstract.subClass({
  13. init: function() {
  14. this.setTargetKey('ldap_user_count');
  15. this.wizardMethod = 'detectEmailAttribute';
  16. this.runsOnRequest = true;
  17. },
  18. /**
  19. * @inheritdoc
  20. */
  21. run: function(model, configID) {
  22. if(model.configuration.ldap_email_attr) {
  23. // a value is already set. Don't overwrite and don't ask LDAP
  24. // without reason.
  25. return false;
  26. }
  27. this._super(model, configID);
  28. }
  29. });
  30. OCA.LDAP.Wizard.WizardDetectorEmailAttribute = WizardDetectorEmailAttribute;
  31. })();