mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
Merge pull request #1064 from sezuan/fix_check_password
Fix check_password
This commit is contained in:
commit
bd3b7cd2df
@ -31,7 +31,7 @@
|
|||||||
-include("logger.hrl").
|
-include("logger.hrl").
|
||||||
|
|
||||||
-export([start/2, stop/1, compile/1, get_cookie/0,
|
-export([start/2, stop/1, compile/1, get_cookie/0,
|
||||||
remove_node/1, set_password/3,
|
remove_node/1, set_password/3, check_password/3,
|
||||||
check_password_hash/4, delete_old_users/1,
|
check_password_hash/4, delete_old_users/1,
|
||||||
delete_old_users_vhost/2, ban_account/3,
|
delete_old_users_vhost/2, ban_account/3,
|
||||||
num_active_users/2, num_resources/2, resource_num/3,
|
num_active_users/2, num_resources/2, resource_num/3,
|
||||||
@ -162,7 +162,7 @@ get_commands_spec() ->
|
|||||||
result_desc = "Status code: 0 on success, 1 otherwise"},
|
result_desc = "Status code: 0 on success, 1 otherwise"},
|
||||||
#ejabberd_commands{name = check_password, tags = [accounts],
|
#ejabberd_commands{name = check_password, tags = [accounts],
|
||||||
desc = "Check if a password is correct",
|
desc = "Check if a password is correct",
|
||||||
module = ejabberd_auth, function = check_password,
|
module = ?MODULE, function = check_password,
|
||||||
args = [{user, binary}, {host, binary}, {password, binary}],
|
args = [{user, binary}, {host, binary}, {password, binary}],
|
||||||
args_example = [<<"peter">>, <<"myserver.com">>, <<"secret">>],
|
args_example = [<<"peter">>, <<"myserver.com">>, <<"secret">>],
|
||||||
args_desc = ["User name to check", "Server to check", "Password to check"],
|
args_desc = ["User name to check", "Server to check", "Password to check"],
|
||||||
@ -593,6 +593,9 @@ set_password(User, Host, Password) ->
|
|||||||
Fun = fun () -> ejabberd_auth:set_password(User, Host, Password) end,
|
Fun = fun () -> ejabberd_auth:set_password(User, Host, Password) end,
|
||||||
user_action(User, Host, Fun, ok).
|
user_action(User, Host, Fun, ok).
|
||||||
|
|
||||||
|
check_password(User, Host, Password) ->
|
||||||
|
ejabberd_auth:check_password(User, <<>>, Host, Password).
|
||||||
|
|
||||||
%% Copied some code from ejabberd_commands.erl
|
%% Copied some code from ejabberd_commands.erl
|
||||||
check_password_hash(User, Host, PasswordHash, HashMethod) ->
|
check_password_hash(User, Host, PasswordHash, HashMethod) ->
|
||||||
AccountPass = ejabberd_auth:get_password_s(User, Host),
|
AccountPass = ejabberd_auth:get_password_s(User, Host),
|
||||||
|
Loading…
Reference in New Issue
Block a user