25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-24 17:29:28 +01:00

Fix Register command to respect mod_register's Access option (#2837)

This commit is contained in:
Badlop 2019-03-22 14:02:03 +01:00
parent 51e7ccc16d
commit 1f2b8adc28

View File

@ -478,7 +478,8 @@ update_module(ModuleNameString) ->
%%%
register(User, Host, Password) ->
case ejabberd_auth:try_register(User, Host, Password) of
{ok, IPRaw} = inet_parse:address(binary_to_list(<<"::ffff:127.0.0.1">>)),
case mod_register:try_register(User, Host, Password, IPRaw, <<"en">>) of
ok ->
{ok, io_lib:format("User ~s@~s successfully registered", [User, Host])};
{error, exists} ->