settings.js 592 B

12345678910111213141516171819202122232425
  1. Meteor.publish('setting', () => {
  2. return Settings.find(
  3. {},
  4. {
  5. fields: {
  6. disableRegistration: 1,
  7. productName: 1,
  8. hideLogo: 1,
  9. customHTMLafterBodyStart: 1,
  10. customHTMLbeforeBodyEnd: 1,
  11. displayAuthenticationMethod: 1,
  12. defaultAuthenticationMethod: 1,
  13. },
  14. },
  15. );
  16. });
  17. Meteor.publish('mailServer', function() {
  18. if (!Match.test(this.userId, String)) return [];
  19. const user = Users.findOne(this.userId);
  20. if (user && user.isAdmin) {
  21. return Settings.find({}, { fields: { mailServer: 1 } });
  22. }
  23. return [];
  24. });