Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var hasGroup = function(groupName, callback) {
now.getGroups(function(groups) {
for(var index in groups) {
if(groupName === groups[index]) {
callback(true);
return;
}
}
callback(false);
});
};
everyone.now.popGroups = function(){
nowjs.getGroups(function(groups){
var i = groups.length;
for(i; i>0;--i){
nowjs.getGroup(groups[i]).getUsers(function(users){
var x = admins.length;
for(x; x>0; --x){
ind = users.indexOf(admins[x]);
if(ind != -1){
users.splice(ind,1);
}
}
if(!users.length){
groups.splice(i,1);
}
undef=groups.indexOf('undefined');
if(undef != -1){
groups.splice(undef,1);