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