From b82b93f8f0c229e94a89469b0754bab0e28cd17c Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Sat, 29 Apr 2017 11:39:40 +0300 Subject: Don't validate an option in ejabberd_config:get_option() functions The commit introduces the following changes: * Now there is no need to pass validating function in ejabberd_config:get_option() functions, because the configuration keeps already validated values. * New function ejabberd_config:get_option/1 is introduced * Function ejabberd_config:get_option/3 is deprecated. If the function is still called, the second argument (validating function) is simply ignored. * The second argument for ejabberd_config:get_option/2 is now a default value, not a validating function. --- src/ejabberd_auth.erl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/ejabberd_auth.erl') diff --git a/src/ejabberd_auth.erl b/src/ejabberd_auth.erl index 8839cf89a..756fafcf6 100644 --- a/src/ejabberd_auth.erl +++ b/src/ejabberd_auth.erl @@ -498,9 +498,7 @@ backend_type(Mod) -> end. password_format(LServer) -> - ejabberd_config:get_option({auth_password_format, LServer}, - opt_type(auth_password_format), - plain). + ejabberd_config:get_option({auth_password_format, LServer}, plain). %%%---------------------------------------------------------------------- %%% Internal functions @@ -513,8 +511,7 @@ auth_modules() -> auth_modules(Server) -> LServer = jid:nameprep(Server), Default = ejabberd_config:default_db(LServer, ?MODULE), - Methods = ejabberd_config:get_option( - {auth_method, LServer}, opt_type(auth_method), [Default]), + Methods = ejabberd_config:get_option({auth_method, LServer}, [Default]), [misc:binary_to_atom(<<"ejabberd_auth_", (misc:atom_to_binary(M))/binary>>) || M <- Methods]. -- cgit v1.2.3