mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
closes #2754
moved group edit from modal to its own page added hidden/private to group edit in acp, they were only in the client groups page moved add users above member list
This commit is contained in:
49
src/controllers/admin/groups.js
Normal file
49
src/controllers/admin/groups.js
Normal file
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
|
||||
var async = require('async'),
|
||||
groups = require('../../groups'),
|
||||
meta = require('../../meta'),
|
||||
helpers = require('../helpers');
|
||||
|
||||
|
||||
var groupsController = {};
|
||||
|
||||
|
||||
groupsController.list = function(req, res, next) {
|
||||
groups.getGroupsFromSet('groups:createtime', req.uid, 0, -1, function(err, groups) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
groups = groups.filter(function(group) {
|
||||
return group && group.name.indexOf(':privileges:') === -1 && group.name !== 'registered-users';
|
||||
});
|
||||
|
||||
res.render('admin/manage/groups', {
|
||||
groups: groups,
|
||||
yourid: req.user.uid
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
groupsController.get = function(req, res, next) {
|
||||
var groupName = res.locals.groupName;
|
||||
async.waterfall([
|
||||
function(next){
|
||||
groups.exists(groupName, next);
|
||||
},
|
||||
function(exists, next) {
|
||||
if (!exists) {
|
||||
helpers.notFound(req, res);
|
||||
}
|
||||
groups.get(groupName, {uid: req.uid}, next);
|
||||
}
|
||||
], function(err, group) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
res.render('admin/manage/group', {group: group});
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = groupsController;
|
||||
Reference in New Issue
Block a user