diff options
author | Matthias Rieber <matthias@zu-con.org> | 2016-04-10 15:37:36 +0200 |
---|---|---|
committer | Matthias Rieber <matthias@zu-con.org> | 2016-04-10 15:37:36 +0200 |
commit | b67dc00db230fd2b0f1fda4345385b0e22567d7b (patch) | |
tree | 1ef086ffd0ec56632835ea989132fc2e8b6ea2d8 /src | |
parent | Switch to varchar(64) in mysql user.server/salt as text can't have default va... (diff) |
Fix check_password
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_admin_extra.erl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mod_admin_extra.erl b/src/mod_admin_extra.erl index cb7947876..b12a80007 100644 --- a/src/mod_admin_extra.erl +++ b/src/mod_admin_extra.erl @@ -31,7 +31,7 @@ -include("logger.hrl"). -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, delete_old_users_vhost/2, ban_account/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"}, #ejabberd_commands{name = check_password, tags = [accounts], 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_example = [<<"peter">>, <<"myserver.com">>, <<"secret">>], 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, 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 check_password_hash(User, Host, PasswordHash, HashMethod) -> AccountPass = ejabberd_auth:get_password_s(User, Host), |