25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Return errors in admin#add-user command response stanza (#2321)

This commit is contained in:
Badlop 2018-03-12 13:32:24 +01:00
parent 2785f1dfd2
commit be33c93344

View File

@ -1528,8 +1528,11 @@ set_form(From, Host, ?NS_ADMINL(<<"add-user">>), _Lang,
true = lists:member(Server, ?MYHOSTS),
true = Server == Host orelse
get_permission_level(From) == global,
ejabberd_auth:try_register(User, Server, Password),
{result, undefined};
case ejabberd_auth:try_register(User, Server, Password) of
ok -> {result, undefined};
{error, exists} -> {error, xmpp:err_conflict()};
{error, not_allowed} -> {error, xmpp:err_not_allowed()}
end;
set_form(From, Host, ?NS_ADMINL(<<"delete-user">>),
_Lang, XData) ->
AccountStringList = get_values(<<"accountjids">>,