mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-05 14:47:12 -04:00
add delete group form groups
This commit is contained in:
parent
7ec4100f0f
commit
eebc308d2a
1 changed files with 25 additions and 0 deletions
|
@ -101,8 +101,33 @@ exports.deleteGroup = function(groupID, callback)
|
|||
//remove group and group2sessions entry
|
||||
function(callback)
|
||||
{
|
||||
// remove group from groups entry
|
||||
db.get("groups", function (err, groups)
|
||||
{
|
||||
if(ERR(err, callback)) return;
|
||||
|
||||
if(ERR(err, callback)) return;
|
||||
|
||||
existingGroups = [];
|
||||
|
||||
if(groups != undefined)
|
||||
{
|
||||
for(var key in groups['groups'])
|
||||
{
|
||||
if(groupID != groups['groups'][key])
|
||||
{
|
||||
existingGroups.push(groups['groups'][key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
db.set("groups", {groups: existingGroups});
|
||||
});
|
||||
|
||||
db.remove("group2sessions:" + groupID);
|
||||
db.remove("group:" + groupID);
|
||||
|
||||
|
||||
callback();
|
||||
}
|
||||
], function(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue