25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

* src/mod_vcard.erl: Ensure mod_vcard to respect FORM_TYPE registry (EJAB-328).

* src/mod_vcard_ldap.erl: Likewise.
* src/mod_vcard_odbc.erl: Likewise.
* doc/guide.tex: Updated documentation.

SVN Revision: 990
This commit is contained in:
Badlop 2007-11-27 14:06:44 +00:00
parent e7136065fc
commit b4997bc20c
5 changed files with 48 additions and 43 deletions

View File

@ -1,5 +1,10 @@
2007-11-27 Badlop <badlop@process-one.net> 2007-11-27 Badlop <badlop@process-one.net>
* src/mod_vcard.erl: Ensure mod_vcard to respect FORM_TYPE registry (EJAB-328).
* src/mod_vcard_ldap.erl: Likewise.
* src/mod_vcard_odbc.erl: Likewise.
* doc/guide.tex: Updated documentation.
* src/mod_muc/mod_muc_room.erl: Don't show the room name as the room description (EJAB-382). * src/mod_muc/mod_muc_room.erl: Don't show the room name as the room description (EJAB-382).
2007-11-26 Badlop <badlop@process-one.net> 2007-11-26 Badlop <badlop@process-one.net>

View File

@ -2998,10 +2998,10 @@ consists of the following \modvcardldap{}-specific options:
\term{"\%u"} will be replaced with the user part of a JID, and \term{"\%d"} \term{"\%u"} will be replaced with the user part of a JID, and \term{"\%d"}
will be replaced with the domain part of a JID. The default is: will be replaced with the domain part of a JID. The default is:
\begin{verbatim} \begin{verbatim}
[{"NICKNAME", "%u", []}, [{"NICK", "%u", []},
{"FN", "%s", ["displayName"]}, {"FN", "%s", ["displayName"]},
{"FAMILY", "%s", ["sn"]}, {"LAST", "%s", ["sn"]},
{"GIVEN", "%s", ["givenName"]}, {"FIRST", "%s", ["givenName"]},
{"MIDDLE", "%s", ["initials"]}, {"MIDDLE", "%s", ["initials"]},
{"ORGNAME", "%s", ["o"]}, {"ORGNAME", "%s", ["o"]},
{"ORGUNIT", "%s", ["ou"]}, {"ORGUNIT", "%s", ["ou"]},
@ -3048,10 +3048,10 @@ consists of the following \modvcardldap{}-specific options:
is: is:
\begin{verbatim} \begin{verbatim}
[{"Full Name", "FN"}, [{"Full Name", "FN"},
{"Given Name", "GIVEN"}, {"Given Name", "FIRST"},
{"Middle Name", "MIDDLE"}, {"Middle Name", "MIDDLE"},
{"Family Name", "FAMILY"}, {"Family Name", "LAST"},
{"Nickname", "NICKNAME"}, {"Nickname", "NICK"},
{"Birthday", "BDAY"}, {"Birthday", "BDAY"},
{"Country", "CTRY"}, {"Country", "CTRY"},
{"City", "LOCALITY"}, {"City", "LOCALITY"},
@ -3106,9 +3106,9 @@ Also we want users to search each other. Let's see how we can set it up:
{ldap_filter, ""}, {ldap_filter, ""},
%% Now we want to define vCard pattern %% Now we want to define vCard pattern
{ldap_vcard_map, {ldap_vcard_map,
[{"NICKNAME", "%u", []}, % just use user's part of JID as his nickname [{"NICK", "%u", []}, % just use user's part of JID as his nickname
{"GIVEN", "%s", ["givenName"]}, {"FIRST", "%s", ["givenName"]},
{"FAMILY", "%s", ["sn"]}, {"LAST", "%s", ["sn"]},
{"FN", "%s, %s", ["sn", "givenName"]}, % example: "Smith, John" {"FN", "%s, %s", ["sn", "givenName"]}, % example: "Smith, John"
{"EMAIL", "%s", ["mail"]}, {"EMAIL", "%s", ["mail"]},
{"BDAY", "%s", ["birthDay"]}]}, {"BDAY", "%s", ["birthDay"]}]},
@ -3123,7 +3123,7 @@ Also we want users to search each other. Let's see how we can set it up:
%% Note that JID is always returned with search results %% Note that JID is always returned with search results
{ldap_search_reported, {ldap_search_reported,
[{"Full Name", "FN"}, [{"Full Name", "FN"},
{"Nickname", "NICKNAME"}, {"Nickname", "NICK"},
{"Birthday", "BDAY"}]} {"Birthday", "BDAY"}]}
]} ]}
... ...
@ -3136,7 +3136,7 @@ searching his info in LDAP.
\item \term{ldap\_vcard\_map} example: \item \term{ldap\_vcard\_map} example:
\begin{verbatim} \begin{verbatim}
{ldap_vcard_map, {ldap_vcard_map,
[{"NICKNAME", "%u", []}, [{"NICK", "%u", []},
{"FN", "%s", ["displayName"]}, {"FN", "%s", ["displayName"]},
{"CTRY", "Russia", []}, {"CTRY", "Russia", []},
{"EMAIL", "%u@%d", []}, {"EMAIL", "%u@%d", []},
@ -3157,7 +3157,7 @@ searching his info in LDAP.
[{"Full Name", "FN"}, [{"Full Name", "FN"},
{"Email", "EMAIL"}, {"Email", "EMAIL"},
{"Birthday", "BDAY"}, {"Birthday", "BDAY"},
{"Nickname", "NICKNAME"} {"Nickname", "NICK"}
]}, ]},
\end{verbatim} \end{verbatim}
\end{itemize} \end{itemize}

View File

@ -272,10 +272,10 @@ set_vcard(User, LServer, VCARD) ->
"match substring)")}]}, "match substring)")}]},
?TLFIELD("text-single", "User", "user"), ?TLFIELD("text-single", "User", "user"),
?TLFIELD("text-single", "Full Name", "fn"), ?TLFIELD("text-single", "Full Name", "fn"),
?TLFIELD("text-single", "Name", "given"), ?TLFIELD("text-single", "Name", "first"),
?TLFIELD("text-single", "Middle Name", "middle"), ?TLFIELD("text-single", "Middle Name", "middle"),
?TLFIELD("text-single", "Family Name", "family"), ?TLFIELD("text-single", "Family Name", "last"),
?TLFIELD("text-single", "Nickname", "nickname"), ?TLFIELD("text-single", "Nickname", "nick"),
?TLFIELD("text-single", "Birthday", "bday"), ?TLFIELD("text-single", "Birthday", "bday"),
?TLFIELD("text-single", "Country", "ctry"), ?TLFIELD("text-single", "Country", "ctry"),
?TLFIELD("text-single", "City", "locality"), ?TLFIELD("text-single", "City", "locality"),
@ -442,10 +442,10 @@ search_result(Lang, JID, ServerHost, Data) ->
{xmlelement, "reported", [], {xmlelement, "reported", [],
[?LFIELD("Jabber ID", "jid"), [?LFIELD("Jabber ID", "jid"),
?LFIELD("Full Name", "fn"), ?LFIELD("Full Name", "fn"),
?LFIELD("Name", "given"), ?LFIELD("Name", "first"),
?LFIELD("Middle Name", "middle"), ?LFIELD("Middle Name", "middle"),
?LFIELD("Family Name", "family"), ?LFIELD("Family Name", "last"),
?LFIELD("Nickname", "nickname"), ?LFIELD("Nickname", "nick"),
?LFIELD("Birthday", "bday"), ?LFIELD("Birthday", "bday"),
?LFIELD("Country", "ctry"), ?LFIELD("Country", "ctry"),
?LFIELD("City", "locality"), ?LFIELD("City", "locality"),
@ -465,10 +465,10 @@ record_to_item(R) ->
[ [
?FIELD("jid", User ++ "@" ++ Server), ?FIELD("jid", User ++ "@" ++ Server),
?FIELD("fn", R#vcard_search.fn), ?FIELD("fn", R#vcard_search.fn),
?FIELD("family", R#vcard_search.family), ?FIELD("last", R#vcard_search.family),
?FIELD("given", R#vcard_search.given), ?FIELD("first", R#vcard_search.given),
?FIELD("middle", R#vcard_search.middle), ?FIELD("middle", R#vcard_search.middle),
?FIELD("nickname", R#vcard_search.nickname), ?FIELD("nick", R#vcard_search.nickname),
?FIELD("bday", R#vcard_search.bday), ?FIELD("bday", R#vcard_search.bday),
?FIELD("ctry", R#vcard_search.ctry), ?FIELD("ctry", R#vcard_search.ctry),
?FIELD("locality", R#vcard_search.locality), ?FIELD("locality", R#vcard_search.locality),
@ -530,10 +530,10 @@ filter_fields([{SVar, [Val]} | Ds], Match, LServer)
Match#vcard_search{us = {make_val(LVal), Host}} Match#vcard_search{us = {make_val(LVal), Host}}
end; end;
"fn" -> Match#vcard_search{lfn = make_val(LVal)}; "fn" -> Match#vcard_search{lfn = make_val(LVal)};
"family" -> Match#vcard_search{lfamily = make_val(LVal)}; "last" -> Match#vcard_search{lfamily = make_val(LVal)};
"given" -> Match#vcard_search{lgiven = make_val(LVal)}; "first" -> Match#vcard_search{lgiven = make_val(LVal)};
"middle" -> Match#vcard_search{lmiddle = make_val(LVal)}; "middle" -> Match#vcard_search{lmiddle = make_val(LVal)};
"nickname" -> Match#vcard_search{lnickname = make_val(LVal)}; "nick" -> Match#vcard_search{lnickname = make_val(LVal)};
"bday" -> Match#vcard_search{lbday = make_val(LVal)}; "bday" -> Match#vcard_search{lbday = make_val(LVal)};
"ctry" -> Match#vcard_search{lctry = make_val(LVal)}; "ctry" -> Match#vcard_search{lctry = make_val(LVal)};
"locality" -> Match#vcard_search{llocality = make_val(LVal)}; "locality" -> Match#vcard_search{llocality = make_val(LVal)};

View File

@ -61,7 +61,7 @@
[{"NICKNAME", "%u", []}, [{"NICKNAME", "%u", []},
{"FN", "%s", ["displayName"]}, {"FN", "%s", ["displayName"]},
{"FAMILY", "%s", ["sn"]}, {"FAMILY", "%s", ["sn"]},
{"GIVEN", "%s", ["givenName"]}, {"FIRST", "%s", ["givenName"]},
{"MIDDLE", "%s", ["initials"]}, {"MIDDLE", "%s", ["initials"]},
{"ORGNAME", "%s", ["o"]}, {"ORGNAME", "%s", ["o"]},
{"ORGUNIT", "%s", ["ou"]}, {"ORGUNIT", "%s", ["ou"]},
@ -97,10 +97,10 @@
-define(SEARCH_REPORTED, -define(SEARCH_REPORTED,
[{"Full Name", "FN"}, [{"Full Name", "FN"},
{"Given Name", "GIVEN"}, {"Given Name", "FIRST"},
{"Middle Name", "MIDDLE"}, {"Middle Name", "MIDDLE"},
{"Family Name", "FAMILY"}, {"Family Name", "LAST"},
{"Nickname", "NICKNAME"}, {"Nickname", "NICK"},
{"Birthday", "BDAY"}, {"Birthday", "BDAY"},
{"Country", "CTRY"}, {"Country", "CTRY"},
{"City", "LOCALITY"}, {"City", "LOCALITY"},
@ -300,7 +300,7 @@ ldap_attribute_to_vcard(vCard, {"fn", Value}) ->
{xmlelement,"FN",[],[{xmlcdata,Value}]}; {xmlelement,"FN",[],[{xmlcdata,Value}]};
ldap_attribute_to_vcard(vCard, {"nickname", Value}) -> ldap_attribute_to_vcard(vCard, {"nickname", Value}) ->
{xmlelement,"NICKNAME",[],[{xmlcdata,Value}]}; {xmlelement,"NICK",[],[{xmlcdata,Value}]};
ldap_attribute_to_vcard(vCard, {"title", Value}) -> ldap_attribute_to_vcard(vCard, {"title", Value}) ->
{xmlelement,"TITLE",[],[{xmlcdata,Value}]}; {xmlelement,"TITLE",[],[{xmlcdata,Value}]};
@ -332,10 +332,10 @@ ldap_attribute_to_vcard(vCard, {"photo", Value}) ->
{xmlelement,"BINVAL",[],[{xmlcdata, jlib:encode_base64(Value)}]}]}; {xmlelement,"BINVAL",[],[{xmlcdata, jlib:encode_base64(Value)}]}]};
ldap_attribute_to_vcard(vCardN, {"family", Value}) -> ldap_attribute_to_vcard(vCardN, {"family", Value}) ->
{xmlelement,"FAMILY",[],[{xmlcdata,Value}]}; {xmlelement,"LAST",[],[{xmlcdata,Value}]};
ldap_attribute_to_vcard(vCardN, {"given", Value}) -> ldap_attribute_to_vcard(vCardN, {"given", Value}) ->
{xmlelement,"GIVEN",[],[{xmlcdata,Value}]}; {xmlelement,"FIRST",[],[{xmlcdata,Value}]};
ldap_attribute_to_vcard(vCardN, {"middle", Value}) -> ldap_attribute_to_vcard(vCardN, {"middle", Value}) ->
{xmlelement,"MIDDLE",[],[{xmlcdata,Value}]}; {xmlelement,"MIDDLE",[],[{xmlcdata,Value}]};

View File

@ -272,10 +272,10 @@ set_vcard(User, LServer, VCARD) ->
"match substring)")}]}, "match substring)")}]},
?TLFIELD("text-single", "User", "user"), ?TLFIELD("text-single", "User", "user"),
?TLFIELD("text-single", "Full Name", "fn"), ?TLFIELD("text-single", "Full Name", "fn"),
?TLFIELD("text-single", "Name", "given"), ?TLFIELD("text-single", "Name", "first"),
?TLFIELD("text-single", "Middle Name", "middle"), ?TLFIELD("text-single", "Middle Name", "middle"),
?TLFIELD("text-single", "Family Name", "family"), ?TLFIELD("text-single", "Family Name", "last"),
?TLFIELD("text-single", "Nickname", "nickname"), ?TLFIELD("text-single", "Nickname", "nick"),
?TLFIELD("text-single", "Birthday", "bday"), ?TLFIELD("text-single", "Birthday", "bday"),
?TLFIELD("text-single", "Country", "ctry"), ?TLFIELD("text-single", "Country", "ctry"),
?TLFIELD("text-single", "City", "locality"), ?TLFIELD("text-single", "City", "locality"),
@ -439,10 +439,10 @@ search_result(Lang, JID, ServerHost, Data) ->
{xmlelement, "reported", [], {xmlelement, "reported", [],
[?LFIELD("Jabber ID", "jid"), [?LFIELD("Jabber ID", "jid"),
?LFIELD("Full Name", "fn"), ?LFIELD("Full Name", "fn"),
?LFIELD("Name", "given"), ?LFIELD("Name", "first"),
?LFIELD("Middle Name", "middle"), ?LFIELD("Middle Name", "middle"),
?LFIELD("Family Name", "family"), ?LFIELD("Family Name", "last"),
?LFIELD("Nickname", "nickname"), ?LFIELD("Nickname", "nick"),
?LFIELD("Birthday", "bday"), ?LFIELD("Birthday", "bday"),
?LFIELD("Country", "ctry"), ?LFIELD("Country", "ctry"),
?LFIELD("City", "locality"), ?LFIELD("City", "locality"),
@ -465,10 +465,10 @@ record_to_item(LServer, {Username, FN, Family, Given, Middle,
[ [
?FIELD("jid", Username ++ "@" ++ LServer), ?FIELD("jid", Username ++ "@" ++ LServer),
?FIELD("fn", FN), ?FIELD("fn", FN),
?FIELD("family", Family), ?FIELD("last", Family),
?FIELD("given", Given), ?FIELD("first", Given),
?FIELD("middle", Middle), ?FIELD("middle", Middle),
?FIELD("nickname", Nickname), ?FIELD("nick", Nickname),
?FIELD("bday", BDay), ?FIELD("bday", BDay),
?FIELD("ctry", CTRY), ?FIELD("ctry", CTRY),
?FIELD("locality", Locality), ?FIELD("locality", Locality),
@ -533,10 +533,10 @@ filter_fields([{SVar, [Val]} | Ds], Match, LServer)
NewMatch = case SVar of NewMatch = case SVar of
"user" -> make_val(Match, "lusername", LVal); "user" -> make_val(Match, "lusername", LVal);
"fn" -> make_val(Match, "lfn", LVal); "fn" -> make_val(Match, "lfn", LVal);
"family" -> make_val(Match, "lfamily", LVal); "last" -> make_val(Match, "lfamily", LVal);
"given" -> make_val(Match, "lgiven", LVal); "first" -> make_val(Match, "lgiven", LVal);
"middle" -> make_val(Match, "lmiddle", LVal); "middle" -> make_val(Match, "lmiddle", LVal);
"nickname" -> make_val(Match, "lnickname", LVal); "nick" -> make_val(Match, "lnickname", LVal);
"bday" -> make_val(Match, "lbday", LVal); "bday" -> make_val(Match, "lbday", LVal);
"ctry" -> make_val(Match, "lctry", LVal); "ctry" -> make_val(Match, "lctry", LVal);
"locality" -> make_val(Match, "llocality", LVal); "locality" -> make_val(Match, "llocality", LVal);