]> granicus.if.org Git - ejabberd/commitdiff
Perform user part substitution in ldap_rfilter (EJAB-1555)
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Tue, 17 Apr 2012 07:19:53 +0000 (17:19 +1000)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Tue, 17 Apr 2012 07:19:53 +0000 (17:19 +1000)
src/mod_shared_roster_ldap.erl

index 229be7fd888dd5579adcda02fe98e7f970189ccb..894b9007636e4e49d1110bfb1c64130508d6dc0d 100644 (file)
@@ -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