mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-20 17:27:00 +01:00
* src/ejabberd_auth.erl: Update from ctl to commands (EJAB-694)
* src/ejabberd_auth_internal.erl: Likewise * src/ejabberd_auth_ldap.erl: Likewise * src/ejabberd_auth_odbc.erl: Likewise SVN Revision: 1638
This commit is contained in:
parent
416a939352
commit
d5c3006136
@ -1,5 +1,10 @@
|
|||||||
2008-10-12 Badlop <badlop@process-one.net>
|
2008-10-12 Badlop <badlop@process-one.net>
|
||||||
|
|
||||||
|
* src/ejabberd_auth.erl: Update from ctl to commands (EJAB-694)
|
||||||
|
* src/ejabberd_auth_internal.erl: Likewise
|
||||||
|
* src/ejabberd_auth_ldap.erl: Likewise
|
||||||
|
* src/ejabberd_auth_odbc.erl: Likewise
|
||||||
|
|
||||||
* src/ejabberdctl.template: Move help print to a separate
|
* src/ejabberdctl.template: Move help print to a separate
|
||||||
function (EJAB-694)
|
function (EJAB-694)
|
||||||
|
|
||||||
|
@ -49,14 +49,12 @@
|
|||||||
is_user_exists_in_other_modules/3,
|
is_user_exists_in_other_modules/3,
|
||||||
remove_user/2,
|
remove_user/2,
|
||||||
remove_user/3,
|
remove_user/3,
|
||||||
plain_password_required/1,
|
plain_password_required/1
|
||||||
ctl_process_get_registered/3
|
|
||||||
]).
|
]).
|
||||||
|
|
||||||
-export([auth_modules/1]).
|
-export([auth_modules/1]).
|
||||||
|
|
||||||
-include("ejabberd.hrl").
|
-include("ejabberd.hrl").
|
||||||
-include("ejabberd_ctl.hrl").
|
|
||||||
|
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
%%% API
|
%%% API
|
||||||
@ -265,15 +263,6 @@ remove_user(User, Server, Password) ->
|
|||||||
M:remove_user(User, Server, Password)
|
M:remove_user(User, Server, Password)
|
||||||
end, auth_modules(Server)).
|
end, auth_modules(Server)).
|
||||||
|
|
||||||
ctl_process_get_registered(_Val, Host, ["registered-users"]) ->
|
|
||||||
Users = ejabberd_auth:get_vh_registered_users(Host),
|
|
||||||
NewLine = io_lib:format("~n", []),
|
|
||||||
SUsers = lists:sort(Users),
|
|
||||||
FUsers = lists:map(fun({U, _S}) -> [U, NewLine] end, SUsers),
|
|
||||||
?PRINT("~s", [FUsers]),
|
|
||||||
{stop, ?STATUS_SUCCESS};
|
|
||||||
ctl_process_get_registered(Val, _Host, _Args) ->
|
|
||||||
Val.
|
|
||||||
|
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
%%% Internal functions
|
%%% Internal functions
|
||||||
|
@ -53,14 +53,10 @@
|
|||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
%%% API
|
%%% API
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
start(Host) ->
|
start(_Host) ->
|
||||||
mnesia:create_table(passwd, [{disc_copies, [node()]},
|
mnesia:create_table(passwd, [{disc_copies, [node()]},
|
||||||
{attributes, record_info(fields, passwd)}]),
|
{attributes, record_info(fields, passwd)}]),
|
||||||
update_table(),
|
update_table(),
|
||||||
ejabberd_ctl:register_commands(
|
|
||||||
Host,
|
|
||||||
[{"registered-users", "list all registered users"}],
|
|
||||||
ejabberd_auth, ctl_process_get_registered),
|
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
plain_password_required() ->
|
plain_password_required() ->
|
||||||
|
@ -112,11 +112,8 @@ start_link(Host) ->
|
|||||||
Proc = gen_mod:get_module_proc(Host, ?MODULE),
|
Proc = gen_mod:get_module_proc(Host, ?MODULE),
|
||||||
gen_server:start_link({local, Proc}, ?MODULE, Host, []).
|
gen_server:start_link({local, Proc}, ?MODULE, Host, []).
|
||||||
|
|
||||||
terminate(_Reason, State) ->
|
terminate(_Reason, _State) ->
|
||||||
ejabberd_ctl:unregister_commands(
|
ok.
|
||||||
State#state.host,
|
|
||||||
[{"registered-users", "list all registered users"}],
|
|
||||||
ejabberd_auth, ctl_process_get_registered).
|
|
||||||
|
|
||||||
init(Host) ->
|
init(Host) ->
|
||||||
State = parse_options(Host),
|
State = parse_options(Host),
|
||||||
@ -132,10 +129,6 @@ init(Host) ->
|
|||||||
State#state.port,
|
State#state.port,
|
||||||
State#state.dn,
|
State#state.dn,
|
||||||
State#state.password),
|
State#state.password),
|
||||||
ejabberd_ctl:register_commands(
|
|
||||||
Host,
|
|
||||||
[{"registered-users", "list all registered users"}],
|
|
||||||
ejabberd_auth, ctl_process_get_registered),
|
|
||||||
{ok, State}.
|
{ok, State}.
|
||||||
|
|
||||||
plain_password_required() ->
|
plain_password_required() ->
|
||||||
|
@ -51,11 +51,7 @@
|
|||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
%%% API
|
%%% API
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
start(Host) ->
|
start(_Host) ->
|
||||||
ejabberd_ctl:register_commands(
|
|
||||||
Host,
|
|
||||||
[{"registered-users", "list all registered users"}],
|
|
||||||
ejabberd_auth, ctl_process_get_registered),
|
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
plain_password_required() ->
|
plain_password_required() ->
|
||||||
|
Loading…
Reference in New Issue
Block a user