user.js error keys

v1.18.x
barisusakli 11 years ago
parent eaf4be4979
commit fdeaf3a16e

@ -25,5 +25,7 @@
"already-favourited": "You already favourited this post",
"already-unfavourited": "You alread unfavourited this post",
"cant-ban-other-admins": "You can't ban other admins!"
"cant-ban-other-admins": "You can't ban other admins!",
"invalid-image-type": "Invalid image type"
}

@ -60,7 +60,7 @@ SocketUser.changePassword = function(socket, data, callback) {
SocketUser.updateProfile = function(socket, data, callback) {
if(!data || !data.uid) {
return callback(new Error('invalid-data'));
return callback(new Error('[[error:invalid-data]]'));
}
if(socket.uid === parseInt(data.uid, 10)) {
@ -73,7 +73,7 @@ SocketUser.updateProfile = function(socket, data, callback) {
}
if(!isAdmin) {
return callback(new Error('not allowed!'));
return callback(new Error('[[error:no-privileges]]'));
}
user.updateProfile(data.uid, data, callback);
@ -82,7 +82,7 @@ SocketUser.updateProfile = function(socket, data, callback) {
SocketUser.changePicture = function(socket, data, callback) {
if(!data) {
return callback(new Error('invalid-data'));
return callback(new Error('[[error:invalid-data]]'));
}
var type = data.type;
@ -117,7 +117,7 @@ SocketUser.changePicture = function(socket, data, callback) {
} else if (type === 'uploaded') {
type = 'uploadedpicture';
} else {
return callback(new Error('invalid-image-type'));
return callback(new Error('[[error:invalid-image-type]]'));
}
if(socket.uid === parseInt(data.uid, 10)) {
@ -136,7 +136,7 @@ SocketUser.changePicture = function(socket, data, callback) {
}
if(!isAdmin) {
return callback(new Error('not-allowed'));
return callback(new Error('[[error:no-privileges]]'));
}
changePicture(data.uid, callback);
@ -170,7 +170,7 @@ SocketUser.saveSettings = function(socket, data, callback) {
SocketUser.getOnlineUsers = function(socket, data, callback) {
var returnData = {};
if(!data) {
return callback(new Error('invalid-data'));
return callback(new Error('[[error:invalid-data]]'));
}
function getUserStatus(uid, next) {
@ -202,11 +202,11 @@ SocketUser.getActiveUsers = function(socket, data, callback) {
SocketUser.loadMore = function(socket, data, callback) {
if(!data || !data.set || parseInt(data.after, 10) < 0) {
return callback(new Error('invalid-data'));
return callback(new Error('[[error:invalid-data]]'));
}
if (!socket.uid && !!parseInt(meta.config.privateUserInfo, 10)) {
return callback(new Error('not-allowed'));
return callback(new Error('[[error:no-privileges]]'));
}
var start = data.after,

Loading…
Cancel
Save