settings.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. Meteor.publish('globalwebhooks', () => {
  2. const boardId = Integrations.Const.GLOBAL_WEBHOOK_ID;
  3. return Integrations.find({
  4. boardId,
  5. });
  6. });
  7. Meteor.publish('setting', () => {
  8. return Settings.find(
  9. {},
  10. {
  11. fields: {
  12. disableRegistration: 1,
  13. productName: 1,
  14. hideLogo: 1,
  15. customLoginLogoImageUrl: 1,
  16. customLoginLogoLinkUrl: 1,
  17. textBelowCustomLoginLogo: 1,
  18. customTopLeftCornerLogoImageUrl: 1,
  19. customTopLeftCornerLogoLinkUrl: 1,
  20. customTopLeftCornerLogoHeight: 1,
  21. customHTMLafterBodyStart: 1,
  22. customHTMLbeforeBodyEnd: 1,
  23. displayAuthenticationMethod: 1,
  24. defaultAuthenticationMethod: 1,
  25. },
  26. },
  27. );
  28. });
  29. Meteor.publish('mailServer', function() {
  30. if (!Match.test(this.userId, String)) return [];
  31. const user = Users.findOne(this.userId);
  32. if (user && user.isAdmin) {
  33. return Settings.find(
  34. {},
  35. {
  36. fields: {
  37. 'mailServer.host': 1,
  38. 'mailServer.port': 1,
  39. 'mailServer.username': 1,
  40. 'mailServer.enableTLS': 1,
  41. 'mailServer.from': 1,
  42. },
  43. },
  44. );
  45. }
  46. return [];
  47. });