fix profile update

v1.18.x
barisusakli 10 years ago
parent 652e247d1b
commit ba6af71150

@ -168,6 +168,7 @@ SocketUser.updateProfile = function(socket, data, callback) {
newUsername: userData.username newUsername: userData.username
}); });
} }
callback(null, userData);
} }
if (socket.uid === parseInt(data.uid, 10)) { if (socket.uid === parseInt(data.uid, 10)) {
@ -175,12 +176,8 @@ SocketUser.updateProfile = function(socket, data, callback) {
} }
user.isAdministrator(socket.uid, function(err, isAdmin) { user.isAdministrator(socket.uid, function(err, isAdmin) {
if (err) { if (err || !isAdmin) {
return callback(err); return callback(err || new Error('[[error:no-privileges]]'));
}
if (!isAdmin) {
return callback(new Error('[[error:no-privileges]]'));
} }
user.updateProfile(data.uid, data, done); user.updateProfile(data.uid, data, done);

Loading…
Cancel
Save