mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +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
|
||||
mssql ->
|
||||
Username = get_mssql_user(Server, User),
|
||||
[odbc, <<"DSN=", Host/binary, ";UID=", Username/binary,
|
||||
[odbc, <<"DSN=", Host/binary, ";UID=", User/binary,
|
||||
";PWD=", Pass/binary>>];
|
||||
_ ->
|
||||
[Type, Server, Port, DB, User, Pass]
|
||||
@ -959,21 +958,6 @@ init_mssql(Host) ->
|
||||
Err
|
||||
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() ->
|
||||
filename:join(["/tmp", "ejabberd"]).
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user