From 9c369b7a8cdb45fe8b14f35cf98df62f4e089eef Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Wed, 27 Apr 2016 17:10:50 +0300 Subject: Improve detection of databases supported by modules (#1092) --- src/ejabberd_auth.erl | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/ejabberd_auth.erl') diff --git a/src/ejabberd_auth.erl b/src/ejabberd_auth.erl index 927abdac..6b7f537c 100644 --- a/src/ejabberd_auth.erl +++ b/src/ejabberd_auth.erl @@ -428,7 +428,7 @@ auth_modules() -> %% Return the list of authenticated modules for a given host auth_modules(Server) -> LServer = jid:nameprep(Server), - Default = gen_mod:default_db(LServer), + Default = ejabberd_config:default_db(LServer, ?MODULE), Methods = ejabberd_config:get_option( {auth_method, LServer}, opt_type(auth_method), [Default]), [jlib:binary_to_atom(<<"ejabberd_auth_", @@ -448,15 +448,9 @@ import(Server, riak, Passwd) -> import(_, _, _) -> pass. --spec v_auth_method(atom()) -> atom(). - -v_auth_method(odbc) -> sql; -v_auth_method(internal) -> mnesia; -v_auth_method(A) when is_atom(A) -> A. - opt_type(auth_method) -> fun (V) when is_list(V) -> - lists:map(fun v_auth_method/1, V); - (V) -> [v_auth_method(V)] + lists:map(fun(M) -> ejabberd_config:v_db(?MODULE, M) end, V); + (V) -> [ejabberd_config:v_db(?MODULE, V)] end; opt_type(_) -> [auth_method]. -- cgit v1.2.3