diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-04-29 11:39:40 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-04-29 11:39:40 +0300 |
commit | b82b93f8f0c229e94a89469b0754bab0e28cd17c (patch) | |
tree | 56f5c7a25aa19254b4f30b1cf33fc34dcbadcbb7 /src/ejabberd_auth_pam.erl | |
parent | Don't re-define validation functions in multiple places (diff) |
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.
Diffstat (limited to 'src/ejabberd_auth_pam.erl')
-rw-r--r-- | src/ejabberd_auth_pam.erl | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/ejabberd_auth_pam.erl b/src/ejabberd_auth_pam.erl index 51ad3a881..974cc8e43 100644 --- a/src/ejabberd_auth_pam.erl +++ b/src/ejabberd_auth_pam.erl @@ -112,18 +112,10 @@ store_type() -> external. %% Internal functions %%==================================================================== get_pam_service(Host) -> - ejabberd_config:get_option( - {pam_service, Host}, - fun iolist_to_binary/1, - <<"ejabberd">>). + ejabberd_config:get_option({pam_service, Host}, <<"ejabberd">>). get_pam_userinfotype(Host) -> - ejabberd_config:get_option( - {pam_userinfotype, Host}, - fun(username) -> username; - (jid) -> jid - end, - username). + ejabberd_config:get_option({pam_userinfotype, Host}, username). opt_type(pam_service) -> fun iolist_to_binary/1; opt_type(pam_userinfotype) -> |