mirror of
https://github.com/processone/ejabberd
synced 2025-10-04 02:09:33 +02:00
Don't validate an option in gen_mod:get*opt() functions
The changes are very similar to those from previous commit: * Now there is no need to pass validating function in gen_mod:get_opt() and gen_mod:get_module_opt() functions, because the modules' configuration keeps already validated values. * New functions gen_mod:get_opt/2 and gen_mod:get_module_opt/3 are introduced. * Functions gen_mod:get_opt/4 and get_module_opt/5 are deprecated. If the functions are still called, the "function" argument is simply ignored. * Validating callback Mod:listen_opt_type/1 is introduced to validate listening options at startup.
This commit is contained in:
parent
2b63d07329
commit
fddd6110e0
67 changed files with 809 additions and 1238 deletions
|
@ -543,9 +543,7 @@ log(Call, Args, IP) ->
|
|||
?INFO_MSG("API call ~s ~p (~p)", [Call, Args, IP]).
|
||||
|
||||
permission_addon() ->
|
||||
Access = gen_mod:get_module_opt(global, ?MODULE, admin_ip_access,
|
||||
fun(V) -> V end,
|
||||
none),
|
||||
Access = gen_mod:get_module_opt(global, ?MODULE, admin_ip_access, none),
|
||||
Rules = acl:resolve_access(Access, global),
|
||||
R = case Rules of
|
||||
all ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue