wizardDetectorUserGroupAssociation.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * SPDX-FileCopyrightText: 2019 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 let's the wizard backend count the available users
  10. *
  11. * @constructor
  12. */
  13. var WizardDetectorUserGroupAssociation = OCA.LDAP.Wizard.WizardDetectorFilterSimpleRequestAbstract.subClass({
  14. init: function() {
  15. this.setTargetKey('ldap_group_count');
  16. this.wizardMethod = 'determineGroupMemberAssoc';
  17. this.runsOnRequest = true;
  18. },
  19. /**
  20. * @inheritdoc
  21. */
  22. run: function(model, configID) {
  23. // TODO: might be better with configuration marker as uniqueMember
  24. // is a valid value (although probably less common then member and memberUid).
  25. if(model.configuration.ldap_group_member_assoc_attribute && model.configuration.ldap_group_member_assoc_attribute !== '') {
  26. // a value is already set. Don't overwrite and don't ask LDAP
  27. // without reason.
  28. return false;
  29. }
  30. this._super(model, configID);
  31. }
  32. });
  33. OCA.LDAP.Wizard.WizardDetectorUserGroupAssociation = WizardDetectorUserGroupAssociation;
  34. })();