wizardDetectorUserGroupAssociation.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 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. })();