mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
fixed conflict
This commit is contained in:
@@ -303,7 +303,12 @@ define(['uploader'], function(uploader) {
|
|||||||
gid = btnEl.parents('tr[data-gid]').attr('data-gid'),
|
gid = btnEl.parents('tr[data-gid]').attr('data-gid'),
|
||||||
privilege = this.getAttribute('data-gpriv');
|
privilege = this.getAttribute('data-gpriv');
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
socket.emit('admin.categories.setGroupPrivilege', cid, gid, privilege, !btnEl.hasClass('active'), function(err) {
|
socket.emit('admin.categories.setGroupPrivilege', {
|
||||||
|
cid: cid,
|
||||||
|
gid: gid,
|
||||||
|
privilege: privilege,
|
||||||
|
set: !btnEl.hasClass('active')
|
||||||
|
}, function(err) {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
btnEl.toggleClass('active');
|
btnEl.toggleClass('active');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ SocketAdmin.categories.setPrivilege = function(socket, data, callback) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketAdmin.categories.getPrivilegeSettings = function(cid, callback) {
|
SocketAdmin.categories.getPrivilegeSettings = function(socket, cid, callback) {
|
||||||
async.parallel({
|
async.parallel({
|
||||||
"+r": function(next) {
|
"+r": function(next) {
|
||||||
groups.getByGroupName('cid:' + cid + ':privileges:+r', { expand: true }, function(err, groupObj) {
|
groups.getByGroupName('cid:' + cid + ':privileges:+r', { expand: true }, function(err, groupObj) {
|
||||||
@@ -182,15 +182,15 @@ SocketAdmin.categories.getPrivilegeSettings = function(cid, callback) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketAdmin.categories.setGroupPrivilege = function(cid, gid, privilege, set, callback) {
|
SocketAdmin.categories.setGroupPrivilege = function(socket, data, callback) {
|
||||||
if (set) {
|
if (data.set) {
|
||||||
groups.joinByGroupName('cid:' + cid + ':privileges:' + privilege, gid, callback);
|
groups.joinByGroupName('cid:' + data.cid + ':privileges:' + data.privilege, data.gid, callback);
|
||||||
} else {
|
} else {
|
||||||
groups.leaveByGroupName('cid:' + cid + ':privileges:' + privilege, gid, callback);
|
groups.leaveByGroupName('cid:' + data.cid + ':privileges:' + data.privilege, data.gid, callback);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketAdmin.categories.groupsList = function(cid, callback) {
|
SocketAdmin.categories.groupsList = function(socket, cid, callback) {
|
||||||
groups.list({expand:false}, function(err, data){
|
groups.list({expand:false}, function(err, data){
|
||||||
async.map(data, function(groupObj, next) {
|
async.map(data, function(groupObj, next) {
|
||||||
CategoryTools.groupPrivileges(cid, groupObj.gid, function(err, privileges) {
|
CategoryTools.groupPrivileges(cid, groupObj.gid, function(err, privileges) {
|
||||||
@@ -213,7 +213,7 @@ SocketAdmin.categories.groupsList = function(cid, callback) {
|
|||||||
SocketAdmin.themes = {};
|
SocketAdmin.themes = {};
|
||||||
SocketAdmin.plugins = {};
|
SocketAdmin.plugins = {};
|
||||||
|
|
||||||
SocketAdmin.themes.getInstalled = function(callback) {
|
SocketAdmin.themes.getInstalled = function(socket, data, callback) {
|
||||||
meta.themes.get(function(err, themeArr) {
|
meta.themes.get(function(err, themeArr) {
|
||||||
callback(themeArr);
|
callback(themeArr);
|
||||||
});
|
});
|
||||||
@@ -221,9 +221,9 @@ SocketAdmin.themes.getInstalled = function(callback) {
|
|||||||
|
|
||||||
SocketAdmin.themes.set = meta.themes.set;
|
SocketAdmin.themes.set = meta.themes.set;
|
||||||
|
|
||||||
SocketAdmin.plugins.toggle = function(plugin_id, sessionData) {
|
SocketAdmin.plugins.toggle = function(socket, plugin_id) {
|
||||||
plugins.toggleActive(plugin_id, function(status) {
|
plugins.toggleActive(plugin_id, function(status) {
|
||||||
sessionData.socket.emit('admin.plugins.toggle', status);
|
socket.emit('admin.plugins.toggle', status);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ SocketAdmin.plugins.toggle = function(plugin_id, sessionData) {
|
|||||||
|
|
||||||
SocketAdmin.config = {};
|
SocketAdmin.config = {};
|
||||||
|
|
||||||
SocketAdmin.config.get = function(callback, sessionData) {
|
SocketAdmin.config.get = function(socket, data, callback) {
|
||||||
meta.configs.list(function(err, config) {
|
meta.configs.list(function(err, config) {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
callback(config);
|
callback(config);
|
||||||
@@ -239,7 +239,7 @@ SocketAdmin.config.get = function(callback, sessionData) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketAdmin.config.set = function(data, callback, sessionData) {
|
SocketAdmin.config.set = function(socket, data, callback) {
|
||||||
meta.configs.set(data.key, data.value, function(err) {
|
meta.configs.set(data.key, data.value, function(err) {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
callback({
|
callback({
|
||||||
@@ -252,11 +252,11 @@ SocketAdmin.config.set = function(data, callback, sessionData) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.monitorConfig({io: sessionData.server}, data);
|
logger.monitorConfig({io: socket.server}, data);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketAdmin.config.remove = function(key) {
|
SocketAdmin.config.remove = function(socket, key) {
|
||||||
meta.configs.remove(key);
|
meta.configs.remove(key);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -264,19 +264,19 @@ SocketAdmin.config.remove = function(key) {
|
|||||||
|
|
||||||
SocketAdmin.groups = {};
|
SocketAdmin.groups = {};
|
||||||
|
|
||||||
SocketAdmin.groups.create = function(data, callback) {
|
SocketAdmin.groups.create = function(socket, data, callback) {
|
||||||
groups.create(data.name, data.description, function(err, groupObj) {
|
groups.create(data.name, data.description, function(err, groupObj) {
|
||||||
callback(err ? err.message : null, groupObj || undefined);
|
callback(err ? err.message : null, groupObj || undefined);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketAdmin.groups.delete = function(gid, callback) {
|
SocketAdmin.groups.delete = function(socket, gid, callback) {
|
||||||
groups.destroy(gid, function(err) {
|
groups.destroy(gid, function(err) {
|
||||||
callback(err ? err.message : null, err ? null : 'OK');
|
callback(err ? err.message : null, err ? null : 'OK');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketAdmin.groups.get = function(gid, callback) {
|
SocketAdmin.groups.get = function(socket, gid, callback) {
|
||||||
groups.get(gid, {
|
groups.get(gid, {
|
||||||
expand: true
|
expand: true
|
||||||
}, function(err, groupObj) {
|
}, function(err, groupObj) {
|
||||||
@@ -284,15 +284,15 @@ SocketAdmin.groups.get = function(gid, callback) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketAdmin.groups.join = function(data, callback) {
|
SocketAdmin.groups.join = function(socket, data, callback) {
|
||||||
groups.join(data.gid, data.uid, callback);
|
groups.join(data.gid, data.uid, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketAdmin.groups.leave = function(data, callback) {
|
SocketAdmin.groups.leave = function(socket, data, callback) {
|
||||||
groups.leave(data.gid, data.uid, callback);
|
groups.leave(data.gid, data.uid, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketAdmin.groups.update = function(data, callback) {
|
SocketAdmin.groups.update = function(socket, data, callback) {
|
||||||
groups.update(data.gid, data.values, function(err) {
|
groups.update(data.gid, data.values, function(err) {
|
||||||
callback(err ? err.message : null);
|
callback(err ? err.message : null);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ var categories = require('../categories'),
|
|||||||
|
|
||||||
SocketCategories = {};
|
SocketCategories = {};
|
||||||
|
|
||||||
SocketCategories.getRecentReplies = function(tid, callback, sessionData) {
|
SocketCategories.getRecentReplies = function(socket, tid, callback) {
|
||||||
categories.getRecentReplies(tid, sessionData.uid, 4, function(err, replies) {
|
categories.getRecentReplies(tid, socket.uid, 4, function(err, replies) {
|
||||||
callback(replies);
|
callback(replies);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketCategories.get = function(callback) {
|
SocketCategories.get = function(socket, data, callback) {
|
||||||
categories.getAllCategories(0, function(err, categories) {
|
categories.getAllCategories(0, function(err, categories) {
|
||||||
if(callback) {
|
if(callback) {
|
||||||
callback(categories);
|
callback(categories);
|
||||||
@@ -16,11 +16,11 @@ SocketCategories.get = function(callback) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketCategories.loadMore = function(data, callback, sessionData) {
|
SocketCategories.loadMore = function(socket, data, callback) {
|
||||||
var start = data.after,
|
var start = data.after,
|
||||||
end = start + 9;
|
end = start + 9;
|
||||||
|
|
||||||
categories.getCategoryTopics(data.cid, start, end, sessionData.uid, function(topics) {
|
categories.getCategoryTopics(data.cid, start, end, socket.uid, function(topics) {
|
||||||
callback({
|
callback({
|
||||||
topics: topics
|
topics: topics
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user