mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
More documentation of arguments in mod_admin_extra
This commit is contained in:
parent
4839ba5ae4
commit
d5b3e6af00
@ -138,68 +138,119 @@ get_commands_spec() ->
|
||||
args = [{days, integer}],
|
||||
args_example = [30],
|
||||
args_desc = ["Last login age in days of accounts that should be removed"],
|
||||
result_example = 0,
|
||||
result_desc = "Status code: 0 on success, 1 otherwise"},
|
||||
result = {res, restuple},
|
||||
result_example = {ok, <<"Deleted 2 users: [\"oldman@myserver.com\", \"test@myserver.com\"]">>},
|
||||
result_desc = "Result tuple"},
|
||||
#ejabberd_commands{name = delete_old_users_vhost, tags = [accounts, purge],
|
||||
desc = "Delete users that didn't log in last days in vhost, or that never logged",
|
||||
module = ?MODULE, function = delete_old_users_vhost,
|
||||
args = [{host, binary}, {days, integer}],
|
||||
result = {res, restuple}},
|
||||
|
||||
args_example = [<<"myserver.com">>, 30],
|
||||
args_desc = ["Server name",
|
||||
"Last login age in days of accounts that should be removed"],
|
||||
result = {res, restuple},
|
||||
result_example = {ok, <<"Deleted 2 users: [\"oldman@myserver.com\", \"test@myserver.com\"]">>},
|
||||
result_desc = "Result tuple"},
|
||||
#ejabberd_commands{name = check_account, tags = [accounts],
|
||||
desc = "Check if an account exists or not",
|
||||
module = ejabberd_auth, function = is_user_exists,
|
||||
args = [{user, binary}, {host, binary}],
|
||||
result = {res, rescode}},
|
||||
args_example = [<<"peter">>, <<"myserver.com">>],
|
||||
args_desc = ["User name to check", "Server to check"],
|
||||
result = {res, rescode},
|
||||
result_example = 0,
|
||||
result_desc = "Status code: 0 on success, 1 otherwise"},
|
||||
#ejabberd_commands{name = check_password, tags = [accounts],
|
||||
desc = "Check if a password is correct",
|
||||
module = ejabberd_auth, function = check_password,
|
||||
args = [{user, binary}, {host, binary}, {password, binary}],
|
||||
result = {res, rescode}},
|
||||
args_example = [<<"peter">>, <<"myserver.com">>, <<"secret">>],
|
||||
args_desc = ["User name to check", "Server to check", "Password to check"],
|
||||
result = {res, rescode},
|
||||
result_example = 0,
|
||||
result_desc = "Status code: 0 on success, 1 otherwise"},
|
||||
#ejabberd_commands{name = check_password_hash, tags = [accounts],
|
||||
desc = "Check if the password hash is correct",
|
||||
longdesc = "Allowed hash methods: md5, sha.",
|
||||
module = ?MODULE, function = check_password_hash,
|
||||
args = [{user, binary}, {host, binary}, {passwordhash, string}, {hashmethod, string}],
|
||||
result = {res, rescode}},
|
||||
args = [{user, binary}, {host, binary}, {passwordhash, string},
|
||||
{hashmethod, string}],
|
||||
args_example = [<<"peter">>, <<"myserver.com">>,
|
||||
<<"5ebe2294ecd0e0f08eab7690d2a6ee69">>, <<"md5">>],
|
||||
args_desc = ["User name to check", "Server to check",
|
||||
"Password's hash value", "Name of hash method"],
|
||||
result = {res, rescode},
|
||||
result_example = 0,
|
||||
result_desc = "Status code: 0 on success, 1 otherwise"},
|
||||
#ejabberd_commands{name = change_password, tags = [accounts],
|
||||
desc = "Change the password of an account",
|
||||
module = ?MODULE, function = set_password,
|
||||
args = [{user, binary}, {host, binary}, {newpass, binary}],
|
||||
result = {res, rescode}},
|
||||
args_example = [<<"peter">>, <<"myserver.com">>, <<"blank">>],
|
||||
args_desc = ["User name", "Server name",
|
||||
"New password for user"],
|
||||
result = {res, rescode},
|
||||
result_example = 0,
|
||||
result_desc = "Status code: 0 on success, 1 otherwise"},
|
||||
#ejabberd_commands{name = ban_account, tags = [accounts],
|
||||
desc = "Ban an account: kick sessions and set random password",
|
||||
module = ?MODULE, function = ban_account,
|
||||
args = [{user, binary}, {host, binary}, {reason, binary}],
|
||||
result = {res, rescode}},
|
||||
|
||||
args_example = [<<"attacker">>, <<"myserver.com">>, <<"Spaming other users">>],
|
||||
args_desc = ["User name to ban", "Server name",
|
||||
"Reason for banning user"],
|
||||
result = {res, rescode},
|
||||
result_example = 0,
|
||||
result_desc = "Status code: 0 on success, 1 otherwise"},
|
||||
#ejabberd_commands{name = num_resources, tags = [session],
|
||||
desc = "Get the number of resources of a user",
|
||||
module = ?MODULE, function = num_resources,
|
||||
args = [{user, binary}, {host, binary}],
|
||||
result = {resources, integer}},
|
||||
args_example = [<<"peter">>, <<"myserver.com">>],
|
||||
args_desc = ["User name", "Server name"],
|
||||
result = {resources, integer},
|
||||
result_example = 5,
|
||||
result_desc = "Number of active resources for a user"},
|
||||
#ejabberd_commands{name = resource_num, tags = [session],
|
||||
desc = "Resource string of a session number",
|
||||
module = ?MODULE, function = resource_num,
|
||||
args = [{user, binary}, {host, binary}, {num, integer}],
|
||||
result = {resource, string}},
|
||||
args_example = [<<"peter">>, <<"myserver.com">>, 2],
|
||||
args_desc = ["User name", "Server name", "ID of resource to return"],
|
||||
result = {resource, string},
|
||||
result_example = <<"Psi">>,
|
||||
result_desc = "Name of user resource"},
|
||||
#ejabberd_commands{name = kick_session, tags = [session],
|
||||
desc = "Kick a user session",
|
||||
module = ?MODULE, function = kick_session,
|
||||
args = [{user, binary}, {host, binary}, {resource, binary}, {reason, binary}],
|
||||
result = {res, rescode}},
|
||||
args_example = [<<"peter">>, <<"myserver.com">>, <<"Psi">>,
|
||||
<<"Stuck connection">>],
|
||||
args_desc = ["User name", "Server name", "User's resource",
|
||||
"Reason for closing session"],
|
||||
result = {res, rescode},
|
||||
result_example = 0,
|
||||
result_desc = "Status code: 0 on success, 1 otherwise"},
|
||||
#ejabberd_commands{name = status_num_host, tags = [session, stats],
|
||||
desc = "Number of logged users with this status in host",
|
||||
policy = admin,
|
||||
module = ?MODULE, function = status_num,
|
||||
args = [{host, binary}, {status, binary}],
|
||||
result = {users, integer}},
|
||||
args_example = [<<"myserver.com">>, <<"dnd">>],
|
||||
args_desc = ["Server name", "Status type to check"],
|
||||
result = {users, integer},
|
||||
result_example = 23,
|
||||
result_desc = "Number of connected sessions with given status type"},
|
||||
#ejabberd_commands{name = status_num, tags = [session, stats],
|
||||
desc = "Number of logged users with this status",
|
||||
policy = admin,
|
||||
module = ?MODULE, function = status_num,
|
||||
args = [{status, binary}],
|
||||
result = {users, integer}},
|
||||
args_example = [<<"dnd">>],
|
||||
args_desc = ["Status type to check"],
|
||||
result = {users, integer},
|
||||
result_example = 23,
|
||||
result_desc = "Number of connected sessions with given status type"},
|
||||
#ejabberd_commands{name = status_list_host, tags = [session],
|
||||
desc = "List of users logged in host with their statuses",
|
||||
module = ?MODULE, function = status_list,
|
||||
|
Loading…
Reference in New Issue
Block a user