Work on refactoring measurements out of Lesion Tracker package
- Removed AssociatedStudies Collection - Measurement API is generated from configuration files - Data exchange methods are defined in configuration
This commit is contained in:
1 parent
c511edd419
commit
ab4d4c9008
537 files changed
+5122
-3545
No files matched your search
@@ -0,0 +1,12 @@
|
||||
// Temporary fix to drop all Collections on server restart
|
||||
// http://stackoverflow.com/questions/23891631/meteor-how-can-i-drop-all-mongo-collections-and-clear-all-data-on-startup
|
||||
Meteor.startup(function() {
|
||||
console.warn('Dropping all Collections!');
|
||||
for (var property in global) {
|
||||
var object = global[property];
|
||||
if (object instanceof Meteor.Collection) {
|
||||
console.warn('Dropping: ' + object._debugName);
|
||||
object.remove({});
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,50 @@
|
||||
Meteor.startup(function () {
|
||||
|
||||
// Mail server settings
|
||||
var username = Meteor.settings && Meteor.settings.mailServerSettings && Meteor.settings.mailServerSettings.username || null;
|
||||
var password = Meteor.settings && Meteor.settings.mailServerSettings && Meteor.settings.mailServerSettings.password || null;
|
||||
var server = Meteor.settings && Meteor.settings.mailServerSettings && Meteor.settings.mailServerSettings.server || null;
|
||||
var port = Meteor.settings && Meteor.settings.mailServerSettings && Meteor.settings.mailServerSettings.port || null;
|
||||
var verifyEmail = Meteor.settings && Meteor.settings.public && Meteor.settings.public.verifyEmail || false;
|
||||
var siteName = Meteor.settings && Meteor.settings.public && Meteor.settings.public.siteName || "Lesion Tracker";
|
||||
|
||||
if (username && password && server && port) {
|
||||
Accounts.emailTemplates.siteName = siteName;
|
||||
Accounts.emailTemplates.from = siteName+' Admin <'+username+'>';
|
||||
|
||||
process.env.MAIL_URL = 'smtp://' +
|
||||
encodeURIComponent(username) + ':' +
|
||||
encodeURIComponent(password) + '@' +
|
||||
encodeURIComponent(server) + ':' + port;
|
||||
|
||||
// Subject line of the email.
|
||||
Accounts.emailTemplates.verifyEmail.subject = function(user) {
|
||||
return 'Confirm Your Email Address for '+siteName;
|
||||
};
|
||||
|
||||
// Email text
|
||||
Accounts.emailTemplates.verifyEmail.text = function(user, url) {
|
||||
return 'Thank you for registering. Please click on the following link to verify your email address: \r\n' + url;
|
||||
};
|
||||
|
||||
// Reset password mail
|
||||
Accounts.emailTemplates.resetPassword.subject = function() {
|
||||
return 'Reset your '+siteName+' password'
|
||||
};
|
||||
|
||||
Accounts.urls.resetPassword = function(token) {
|
||||
return Meteor.absoluteUrl('resetPassword/' + token);
|
||||
};
|
||||
|
||||
Accounts.emailTemplates.resetPassword.text = function(user, url) {
|
||||
return "Hello " + user.profile.fullName + ",\n\n" +
|
||||
"Click the following link to set your new password:\n" +
|
||||
url + "\n\n";
|
||||
};
|
||||
|
||||
// Send email when account is created
|
||||
Accounts.config({
|
||||
sendVerificationEmail: verifyEmail
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user