Update auth modules to support stopping

This commit is contained in:
Badlop 2010-12-22 17:54:41 +01:00
parent 0859667a8c
commit 75f2e775ab
4 changed files with 28 additions and 0 deletions

View File

@ -28,6 +28,7 @@
-author('mickael.remond@process-one.net').
-export([start/1,
stop/1,
allow_anonymous/1,
is_sasl_anonymous_enabled/1,
is_login_anonymous_enabled/1,
@ -79,6 +80,14 @@ start(Host) when is_list(Host) ->
?MODULE, unregister_connection, 100),
ok.
stop(Host) when is_list(Host) ->
HostB = list_to_binary(Host),
ejabberd_hooks:delete(sm_register_connection_hook, HostB,
?MODULE, register_connection, 100),
ejabberd_hooks:delete(sm_remove_connection_hook, HostB,
?MODULE, unregister_connection, 100),
ok.
%% @spec (Host) -> bool()
%% Host = string()
%% @doc Return true if anonymous is allowed for host or false otherwise.

View File

@ -29,6 +29,7 @@
%% External exports
-export([start/1,
stop/1,
set_password/3,
check_password/3,
check_password/5,
@ -65,6 +66,15 @@ start(Host) ->
ok
end.
stop(Host) ->
extauth:stop(Host),
case check_cache_last_options(Host) of
cache ->
ok = ejabberd_auth_storage:stop(Host);
no_cache ->
ok
end.
check_cache_last_options(Server) ->
%% if extauth_cache is enabled, then a mod_last module must also be enabled
case get_cache_option(Server) of

View File

@ -28,6 +28,7 @@
%% External exports
-export([start/1,
stop/1,
set_password/3,
check_password/3,
check_password/5,
@ -56,6 +57,10 @@ start(_Host) ->
Err -> Err
end.
%% TODO: Stop epam if no other auth_pam are running.
stop(_Host) ->
ok.
%% @spec (User, Server, Password) -> {error, not_allowed}
%% User = string()
%% Server = string()

View File

@ -54,6 +54,7 @@
%% External exports
-export([start/1,
stop/1,
set_password/3,
check_password/3,
check_password/5,
@ -103,6 +104,9 @@ start(Host) ->
update_reg_users_counter_table(Host),
ok.
stop(_Host) ->
ok.
update_reg_users_counter_table(Server) ->
Set = get_vh_registered_users(Server),
Size = length(Set),