add hook: filter: user.updateProfile

v1.18.x
Steve Lacy 10 years ago
parent 90224d2de3
commit 3ff7719cd4

@ -9,11 +9,19 @@ var async = require('async'),
meta = require('../meta'),
events = require('../events'),
db = require('../database'),
Password = require('../password');
Password = require('../password'),
plugins = require('./../plugins');
module.exports = function(User) {
User.updateProfile = function(uid, data, callback) {
plugins.fireHook('filter:user.updateProfile', {uid: uid, settings: data.settings}, function(err, data) {
if(err) {
return callback(err);
}
data = data.settings;
var fields = ['username', 'email', 'fullname', 'website', 'location', 'birthday', 'signature'];
function isSignatureValid(next) {
@ -115,6 +123,7 @@ module.exports = function(User) {
User.setUserField(uid, field, data[field], next);
}
});
};
function updateEmail(uid, newEmail, callback) {

Loading…
Cancel
Save