summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-02-25 17:11:00 -0500
committerPeter Kozak <spag@golwen.net>2013-02-25 17:11:00 -0500
commit08285c5324b03c307d34313d5030a6e95ed09068 (patch)
tree4ff4acd680301a24fc3414cdc128d6a67eab3f02
parentdca264b22845b7875b9493c17cc185e809372cc1 (diff)
return active groups only
-rw-r--r--misc/freeswitch/scripts/common/group.lua2
1 files changed, 2 insertions, 0 deletions
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 = {};