diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-08-08 17:46:26 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-08-08 17:46:26 +0300 |
commit | 3fec782494042ab1e1a015524e01cd63e6757c7e (patch) | |
tree | 55be45f1d6861e5e8de6c33648a447d87e27eb4c /src/mod_vcard_ldap.erl | |
parent | Fix tests for 8679cfd2f (diff) |
Introduce 'hosts' option
The option can be used as a replacement of 'host' option
when several (sub)domains are needed to be registered for the module.
Note that you cannot combine both 'host' and 'hosts' in the config
because 'host' option is of a higher priority. Example:
mod_pubsub:
...
hosts:
- "pubsub1.@HOST@"
- "pubsub2.@HOST@"
Fixes #1883
Diffstat (limited to 'src/mod_vcard_ldap.erl')
-rw-r--r-- | src/mod_vcard_ldap.erl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mod_vcard_ldap.erl b/src/mod_vcard_ldap.erl index f1f076468..38c4747e6 100644 --- a/src/mod_vcard_ldap.erl +++ b/src/mod_vcard_ldap.erl @@ -47,7 +47,7 @@ -record(state, {serverhost = <<"">> :: binary(), - myhost = <<"">> :: binary(), + myhosts = [] :: [binary()], eldap_id = <<"">> :: binary(), search = false :: boolean(), servers = [] :: [binary()], @@ -351,8 +351,7 @@ default_search_reported() -> {<<"Organization Unit">>, <<"ORGUNIT">>}]. parse_options(Host, Opts) -> - MyHost = gen_mod:get_opt_host(Host, Opts, - <<"vjud.@HOST@">>), + MyHosts = gen_mod:get_opt_hosts(Host, Opts, <<"vjud.@HOST@">>), Search = gen_mod:get_opt(search, Opts, false), Matches = gen_mod:get_opt(matches, Opts, 30), Eldap_ID = misc:atom_to_binary(gen_mod:get_module_proc(Host, ?PROCNAME)), @@ -394,7 +393,7 @@ parse_options(Host, Opts) -> end, SearchReported) ++ UIDAttrs), - #state{serverhost = Host, myhost = MyHost, + #state{serverhost = Host, myhosts = MyHosts, eldap_id = Eldap_ID, search = Search, servers = Cfg#eldap_config.servers, backups = Cfg#eldap_config.backups, |