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

Do not auto append IP suffix to usernames (#1008)

This commit is contained in:
Evgeniy Khramtsov 2016-03-22 13:25:34 +03:00
parent f8cf1aef91
commit 57f7b34b90

View File

@ -898,8 +898,7 @@ db_opts(Host) ->
<<"">>), <<"">>),
case Type of case Type of
mssql -> mssql ->
Username = get_mssql_user(Server, User), [odbc, <<"DSN=", Host/binary, ";UID=", User/binary,
[odbc, <<"DSN=", Host/binary, ";UID=", Username/binary,
";PWD=", Pass/binary>>]; ";PWD=", Pass/binary>>];
_ -> _ ->
[Type, Server, Port, DB, User, Pass] [Type, Server, Port, DB, User, Pass]
@ -959,21 +958,6 @@ init_mssql(Host) ->
Err Err
end. end.
get_mssql_user(Server, User) ->
HostName = case inet_parse:address(binary_to_list(Server)) of
{ok, _} ->
Server;
{error, _} ->
hd(str:tokens(Server, <<".">>))
end,
UserName = case str:chr(User, $@) of
0 ->
<<User/binary, $@, HostName/binary>>;
_ ->
User
end,
UserName.
tmp_dir() -> tmp_dir() ->
filename:join(["/tmp", "ejabberd"]). filename:join(["/tmp", "ejabberd"]).