|
|
|
@ -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) {
|
|
|
|
|