aboutsummaryrefslogtreecommitdiff
path: root/src/ejabberd_auth_anonymous.erl
diff options
context:
space:
mode:
authorMickaël Rémond <mickael.remond@process-one.net>2010-01-09 15:15:46 +0000
committerMickaël Rémond <mickael.remond@process-one.net>2010-01-09 15:15:46 +0000
commit24aefc429c90c76ae397607a3d1ce24861575ff7 (patch)
tree2b96322129cda6fc71943f1f0d32b805ed21f69d /src/ejabberd_auth_anonymous.erl
parentAn AccessCommand with Access 'all', don't require auth to execute it. (diff)
Small refactoring
SVN Revision: 2867
Diffstat (limited to '')
-rw-r--r--src/ejabberd_auth_anonymous.erl13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/ejabberd_auth_anonymous.erl b/src/ejabberd_auth_anonymous.erl
index 05b9c98f5..2a445f34e 100644
--- a/src/ejabberd_auth_anonymous.erl
+++ b/src/ejabberd_auth_anonymous.erl
@@ -79,7 +79,7 @@ allow_anonymous(Host) ->
%% anonymous protocol can be: sasl_anon|login_anon|both
is_sasl_anonymous_enabled(Host) ->
case allow_anonymous(Host) of
- false -> false;
+ false -> false;
true ->
case anonymous_protocol(Host) of
sasl_anon -> true;
@@ -97,7 +97,7 @@ is_login_anonymous_enabled(Host) ->
true ->
case anonymous_protocol(Host) of
login_anon -> true;
- both -> true;
+ both -> true;
_Other -> false
end
end.
@@ -115,10 +115,8 @@ anonymous_protocol(Host) ->
%% Return true if multiple connections have been allowed in the config file
%% defaults to false
allow_multiple_connections(Host) ->
- case ejabberd_config:get_local_option({allow_multiple_connections, Host}) of
- true -> true;
- _Other -> false
- end.
+ ejabberd_config:get_local_option(
+ {allow_multiple_connections, Host}) =:= true.
%% Check if user exist in the anonymus database
anonymous_user_exist(User, Server) ->
@@ -176,7 +174,7 @@ check_password(User, Server, Password) ->
check_password(User, Server, _Password, _Digest, _DigestGen) ->
%% We refuse login for registered accounts (They cannot logged but
%% they however are "reserved")
- case ejabberd_auth:is_user_exists_in_other_modules(?MODULE,
+ case ejabberd_auth:is_user_exists_in_other_modules(?MODULE,
User, Server) of
%% If user exists in other module, reject anonnymous authentication
true -> false;
@@ -248,4 +246,3 @@ remove_user(_User, _Server, _Password) ->
plain_password_required() ->
false.
-