diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ejabberd.cfg.example | 13 | ||||
-rw-r--r-- | src/ejabberd_auth_anonymous.erl | 12 |
2 files changed, 7 insertions, 18 deletions
diff --git a/src/ejabberd.cfg.example b/src/ejabberd.cfg.example index 9fa19682f..bbad0d834 100644 --- a/src/ejabberd.cfg.example +++ b/src/ejabberd.cfg.example @@ -97,16 +97,13 @@ % Host name: {hosts, ["localhost"]}. - %% Anonymous login support: -%% anonymous_protocol: sasl_anon|login_anon|both -%% allow_multiple_connections: true|false -%% anon_digest_password: "anonymous" (this is the default password that should -%% be use for digest login). +%% auth_method: anonymous +%% anonymous_protocol: sasl_anon|login_anon|both +%% allow_multiple_connections: true|false %%{host_config, "public.example.org", [{auth_method, anonymous}, -%% {allow_multiple_connections, false}, -%% {anonymous_protocol, sasl_anon}, -%% {anon_digest_password, "anonymous"}]}. +%% {allow_multiple_connections, false}, +%% {anonymous_protocol, sasl_anon}]}. %% To use both anonymous and internal authentication: %%{host_config, "public.example.org", [{auth_method, [anonymous, internal]}]}. diff --git a/src/ejabberd_auth_anonymous.erl b/src/ejabberd_auth_anonymous.erl index 5b731d874..e63c66488 100644 --- a/src/ejabberd_auth_anonymous.erl +++ b/src/ejabberd_auth_anonymous.erl @@ -60,7 +60,7 @@ start(Host) -> %% Return true if anonymous is allowed for host or false otherwise allow_anonymous(Host) -> - lists:member(anonymous, ejabberd_auth:auth_modules(Host)). + lists:member(?MODULE, ejabberd_auth:auth_modules(Host)). %% Return true if anonymous mode is enabled and if anonymous protocol is SASL %% anonymous protocol can be: sasl_anon|login_anon|both @@ -192,8 +192,7 @@ get_vh_registered_users(_Server) -> %% Return password of permanent user or false for anonymous users get_password(User, Server) -> - DefaultPassword = get_default_password(Server), - get_password(User, Server, DefaultPassword). + get_password(User, Server, ""). get_password(User, Server, DefaultValue) -> case anonymous_user_exist(User, Server) of @@ -205,13 +204,6 @@ get_password(User, Server, DefaultValue) -> false end. -%% Return the default digest password from the config file -get_default_password(Host) -> - case ejabberd_config:get_local_option({anon_digest_password, Host}) of - undefined -> ""; - Pass -> Pass - end. - %% Returns true if the user exists in the DB or if an anonymous user is logged %% under the given name is_user_exists(User, Server) -> |