aboutsummaryrefslogtreecommitdiff
path: root/src/ejabberd_auth_anonymous.erl
diff options
context:
space:
mode:
authorEvgeny Khramtsov <ekhramtsov@process-one.net>2019-06-14 12:33:26 +0300
committerEvgeny Khramtsov <ekhramtsov@process-one.net>2019-06-14 12:33:26 +0300
commita02cff0e780bb735531594c4ece81e8628f79782 (patch)
tree6fe7d8219d14f58183be1741fcea262c216db447 /src/ejabberd_auth_anonymous.erl
parentReturn jid_malformed error when sending presence without nick to conference (diff)
Use new configuration validator
Diffstat (limited to 'src/ejabberd_auth_anonymous.erl')
-rw-r--r--src/ejabberd_auth_anonymous.erl18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/ejabberd_auth_anonymous.erl b/src/ejabberd_auth_anonymous.erl
index 767d99bf2..805076aff 100644
--- a/src/ejabberd_auth_anonymous.erl
+++ b/src/ejabberd_auth_anonymous.erl
@@ -25,7 +25,6 @@
-module(ejabberd_auth_anonymous).
--behaviour(ejabberd_config).
-behaviour(ejabberd_auth).
-author('mickael.remond@process-one.net').
@@ -43,7 +42,7 @@
-export([login/2, check_password/4, user_exists/2,
get_users/2, count_users/2, store_type/1,
- plain_password_required/1, opt_type/1]).
+ plain_password_required/1]).
-include("logger.hrl").
-include("jid.hrl").
@@ -98,12 +97,12 @@ is_login_anonymous_enabled(Host) ->
%% Return the anonymous protocol to use: sasl_anon|login_anon|both
%% defaults to login_anon
anonymous_protocol(Host) ->
- ejabberd_config:get_option({anonymous_protocol, Host}, sasl_anon).
+ ejabberd_option:anonymous_protocol(Host).
%% Return true if multiple connections have been allowed in the config file
%% defaults to false
allow_multiple_connections(Host) ->
- ejabberd_config:get_option({allow_multiple_connections, Host}, false).
+ ejabberd_option:allow_multiple_connections(Host).
anonymous_user_exist(User, Server) ->
lists:any(
@@ -188,14 +187,3 @@ plain_password_required(_) ->
store_type(_) ->
external.
-
--spec opt_type(atom()) -> fun((any()) -> any()) | [atom()].
-opt_type(allow_multiple_connections) ->
- fun (V) when is_boolean(V) -> V end;
-opt_type(anonymous_protocol) ->
- fun (sasl_anon) -> sasl_anon;
- (login_anon) -> login_anon;
- (both) -> both
- end;
-opt_type(_) ->
- [allow_multiple_connections, anonymous_protocol].