From e616d2686f7be6f409d5869ff574f5bd2819b213 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Tue, 17 Apr 2012 17:19:53 +1000 Subject: [PATCH] Perform user part substitution in ldap_rfilter (EJAB-1555) --- src/mod_shared_roster_ldap.erl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mod_shared_roster_ldap.erl b/src/mod_shared_roster_ldap.erl index 229be7fd8..894b90076 100644 --- a/src/mod_shared_roster_ldap.erl +++ b/src/mod_shared_roster_ldap.erl @@ -329,10 +329,13 @@ eldap_search(State, FilterParseArgs, AttributesList) -> [] end. -get_user_displayed_groups({_User, Host}) -> +get_user_displayed_groups({User, Host}) -> {ok, State} = eldap_utils:get_state(Host, ?MODULE), GroupAttr = State#state.group_attr, - Entries = eldap_search(State, [State#state.rfilter], [GroupAttr]), + Entries = eldap_search( + State, + [eldap_filter:do_sub(State#state.rfilter, [{"%u", User}])], + [GroupAttr]), Reply = lists:flatmap( fun(#eldap_entry{attributes = Attrs}) -> case Attrs of