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:
parent
f8cf1aef91
commit
57f7b34b90
@ -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"]).
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user