From 08285c5324b03c307d34313d5030a6e95ed09068 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Mon, 25 Feb 2013 17:11:00 -0500 Subject: return active groups only --- misc/freeswitch/scripts/common/group.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'misc') diff --git a/misc/freeswitch/scripts/common/group.lua b/misc/freeswitch/scripts/common/group.lua index 1a2d315..c4125bc 100644 --- a/misc/freeswitch/scripts/common/group.lua +++ b/misc/freeswitch/scripts/common/group.lua @@ -48,6 +48,7 @@ function Group.name_id_by_permission(self, member_id, member_type, permission) WHERE `b`.`item_type` = ' .. self.database:escape(member_type, '"') .. ' \ AND `b`.`item_id` = ' .. member_id .. ' \ AND `a`.`permission` = ' .. self.database:escape(permission, '"') .. ' \ + AND `c`.`active` IS TRUE \ GROUP BY `b`.`group_id` LIMIT ' .. MAX_GROUP_MEMBERSHIPS; local group_names = {}; @@ -72,6 +73,7 @@ function Group.name_id_by_member(self, member_id, member_type) JOIN `groups` `c` ON `c`.`id` = `b`.`group_id` \ WHERE `b`.`item_type` = ' .. self.database:escape(member_type, '"') .. ' \ AND `b`.`item_id` = ' .. member_id .. ' \ + AND `c`.`active` IS TRUE \ GROUP BY `b`.`group_id` LIMIT ' .. MAX_GROUP_MEMBERSHIPS; local group_names = {}; -- cgit v1.2.3