user registration now no longer sends a welcome email if no emailers are present

v1.18.x
Julian Lam 11 years ago
parent d7d4290099
commit 96b2a15290

@ -202,8 +202,8 @@ var fs = require('fs'),
} else return;
};
Plugins.hasListeners = function(hook, callback) {
return Plugins.loadedHooks[hook].length > 0;
Plugins.hasListeners = function(hook) {
return (Plugins.loadedHooks[hook] && Plugins.loadedHooks[hook].length > 0);
};
Plugins.fireHook = function(hook, args, callback) {

@ -886,6 +886,10 @@ var bcrypt = require('bcrypt'),
User.email = {
verify: function(uid, email) {
if (!plugins.hasListeners('action:email.send')) {
return;
}
var confirm_code = utils.generateUUID(),
confirm_link = nconf.get('url') + '/confirm/' + confirm_code;

Loading…
Cancel
Save