From 4f9497d358c4a6c65f88b8c021e476803dfa0ea9 Mon Sep 17 00:00:00 2001 From: Alexey Shchepin Date: Tue, 26 Apr 2005 11:22:04 +0000 Subject: [PATCH] * src/mod_vcard_ldap.erl: Bugfix (thanks to Mickael Remond) SVN Revision: 329 --- ChangeLog | 4 ++++ src/mod_vcard_ldap.erl | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3ae5a083f..0487c882e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-04-26 Alexey Shchepin + + * src/mod_vcard_ldap.erl: Bugfix (thanks to Mickael Remond) + 2005-04-24 Alexey Shchepin * src/web/ejabberd_web_admin.erl: Added translation to submit diff --git a/src/mod_vcard_ldap.erl b/src/mod_vcard_ldap.erl index 2eccf84c9..46b5c86e0 100644 --- a/src/mod_vcard_ldap.erl +++ b/src/mod_vcard_ldap.erl @@ -401,7 +401,7 @@ search_result(Lang, JID, Data) -> ?LFIELD("Organization Unit", "orgunit") ]}] ++ lists:map(fun(E) -> record_to_item(E#eldap_entry.attributes) - end, search(Data)). + end, search(JID#jid.lserver, Data)). -define(FIELD(Var, Val), {xmlelement, "field", [{"var", Var}], @@ -489,15 +489,17 @@ record_to_item(Attributes) -> FList = [X || X <- List, X /= none], {xmlelement, "item", [],FList}. -search(Data) -> +search(LServer, Data) -> Filter = make_filter(Data), Base = ejabberd_config:get_local_option(ldap_base), UIDAttr = ejabberd_config:get_local_option(ldap_uidattr), - case eldap:search("mod_vcard_ldap",[{base,Base}, + case eldap:search("mod_vcard_ldap",[{base, Base}, {filter, Filter}, {attributes, []}]) of #eldap_search_result{entries = E} -> - [X || X <- E, ejabberd_auth:is_user_exists(ldap_get_value(X,UIDAttr)) ]; + [X || X <- E, + ejabberd_auth:is_user_exists( + ldap_get_value(X, UIDAttr), LServer)]; _ -> ?ERROR_MSG("~p", ["Bad search"]) end.