You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

wizardDetectorEmailAttribute.js 915B

1234567891011121314151617181920212223242526272829303132333435363738
  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 WizardDetectorEmailAttribute = OCA.LDAP.Wizard.WizardDetectorFilterSimpleRequestAbstract.subClass({
  14. init: function() {
  15. this.setTargetKey('ldap_user_count');
  16. this.wizardMethod = 'detectEmailAttribute';
  17. this.runsOnRequest = true;
  18. },
  19. /**
  20. * @inheritdoc
  21. */
  22. run: function(model, configID) {
  23. if(model.configuration.ldap_email_attr) {
  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.WizardDetectorEmailAttribute = WizardDetectorEmailAttribute;
  32. })();