wizardDetectorUserDisplayNameAttribute.js 1003 B

12345678910111213141516171819202122232425262728293031323334353637
  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 WizardDetectorUserDisplayNameAttribute = OCA.LDAP.Wizard.WizardDetectorFilterSimpleRequestAbstract.subClass({
  13. init: function() {
  14. this.setTargetKey('ldap_user_count');
  15. this.wizardMethod = 'detectUserDisplayNameAttribute';
  16. this.runsOnRequest = true;
  17. },
  18. /**
  19. * @inheritdoc
  20. */
  21. run: function(model, configID) {
  22. // default value has capital N. Detected values are always lowercase
  23. if(model.configuration.ldap_display_name && model.configuration.ldap_display_name !== 'displayName') {
  24. // a value is already set. Don't overwrite and don't ask LDAP
  25. // without reason.
  26. return false;
  27. }
  28. this._super(model, configID);
  29. }
  30. });
  31. OCA.LDAP.Wizard.WizardDetectorUserDisplayNameAttribute = WizardDetectorUserDisplayNameAttribute;
  32. })();