mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
ejabberd_auth*: Fix indentation
This commit is contained in:
parent
2a9dd548b5
commit
a2f0e157bc
@ -78,13 +78,15 @@ store_type() -> external.
|
|||||||
|
|
||||||
check_password(User, AuthzId, Server, Password) ->
|
check_password(User, AuthzId, Server, Password) ->
|
||||||
if AuthzId /= <<>> andalso AuthzId /= User ->
|
if AuthzId /= <<>> andalso AuthzId /= User ->
|
||||||
false;
|
false;
|
||||||
true ->
|
true ->
|
||||||
case get_cache_option(Server) of
|
case get_cache_option(Server) of
|
||||||
false -> check_password_extauth(User, AuthzId, Server, Password);
|
false ->
|
||||||
{true, CacheTime} ->
|
check_password_extauth(User, AuthzId, Server, Password);
|
||||||
check_password_cache(User, AuthzId, Server, Password, CacheTime)
|
{true, CacheTime} ->
|
||||||
end
|
check_password_cache(User, AuthzId, Server, Password,
|
||||||
|
CacheTime)
|
||||||
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
check_password(User, AuthzId, Server, Password, _Digest,
|
check_password(User, AuthzId, Server, Password, _Digest,
|
||||||
|
@ -118,16 +118,15 @@ store_type() -> external.
|
|||||||
|
|
||||||
check_password(User, AuthzId, Server, Password) ->
|
check_password(User, AuthzId, Server, Password) ->
|
||||||
if AuthzId /= <<>> andalso AuthzId /= User ->
|
if AuthzId /= <<>> andalso AuthzId /= User ->
|
||||||
false;
|
false;
|
||||||
true ->
|
|
||||||
if Password == <<"">> -> false;
|
|
||||||
true ->
|
true ->
|
||||||
case catch check_password_ldap(User, Server, Password)
|
if Password == <<"">> -> false;
|
||||||
of
|
true ->
|
||||||
{'EXIT', _} -> false;
|
case catch check_password_ldap(User, Server, Password) of
|
||||||
Result -> Result
|
{'EXIT', _} -> false;
|
||||||
end
|
Result -> Result
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
check_password(User, AuthzId, Server, Password, _Digest,
|
check_password(User, AuthzId, Server, Password, _Digest,
|
||||||
|
@ -91,51 +91,48 @@ store_type() ->
|
|||||||
|
|
||||||
check_password(User, AuthzId, Server, Password) ->
|
check_password(User, AuthzId, Server, Password) ->
|
||||||
if AuthzId /= <<>> andalso AuthzId /= User ->
|
if AuthzId /= <<>> andalso AuthzId /= User ->
|
||||||
false;
|
false;
|
||||||
true ->
|
true ->
|
||||||
LUser = jid:nodeprep(User),
|
LUser = jid:nodeprep(User),
|
||||||
LServer = jid:nameprep(Server),
|
LServer = jid:nameprep(Server),
|
||||||
US = {LUser, LServer},
|
US = {LUser, LServer},
|
||||||
case catch mnesia:dirty_read({passwd, US}) of
|
case catch mnesia:dirty_read({passwd, US}) of
|
||||||
[#passwd{password = Password}]
|
[#passwd{password = Password}] when is_binary(Password) ->
|
||||||
when is_binary(Password) ->
|
Password /= <<"">>;
|
||||||
Password /= <<"">>;
|
[#passwd{password = Scram}] when is_record(Scram, scram) ->
|
||||||
[#passwd{password = Scram}]
|
is_password_scram_valid(Password, Scram);
|
||||||
when is_record(Scram, scram) ->
|
_ -> false
|
||||||
is_password_scram_valid(Password, Scram);
|
end
|
||||||
_ -> false
|
|
||||||
end
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
check_password(User, AuthzId, Server, Password, Digest,
|
check_password(User, AuthzId, Server, Password, Digest,
|
||||||
DigestGen) ->
|
DigestGen) ->
|
||||||
if AuthzId /= <<>> andalso AuthzId /= User ->
|
if AuthzId /= <<>> andalso AuthzId /= User ->
|
||||||
false;
|
false;
|
||||||
true ->
|
true ->
|
||||||
LUser = jid:nodeprep(User),
|
LUser = jid:nodeprep(User),
|
||||||
LServer = jid:nameprep(Server),
|
LServer = jid:nameprep(Server),
|
||||||
US = {LUser, LServer},
|
US = {LUser, LServer},
|
||||||
case catch mnesia:dirty_read({passwd, US}) of
|
case catch mnesia:dirty_read({passwd, US}) of
|
||||||
[#passwd{password = Passwd}] when is_binary(Passwd) ->
|
[#passwd{password = Passwd}] when is_binary(Passwd) ->
|
||||||
DigRes = if Digest /= <<"">> ->
|
DigRes = if Digest /= <<"">> ->
|
||||||
Digest == DigestGen(Passwd);
|
Digest == DigestGen(Passwd);
|
||||||
true -> false
|
true -> false
|
||||||
end,
|
end,
|
||||||
if DigRes -> true;
|
if DigRes -> true;
|
||||||
true -> (Passwd == Password) and (Password /= <<"">>)
|
true -> (Passwd == Password) and (Password /= <<"">>)
|
||||||
end;
|
end;
|
||||||
[#passwd{password = Scram}]
|
[#passwd{password = Scram}] when is_record(Scram, scram) ->
|
||||||
when is_record(Scram, scram) ->
|
Passwd = jlib:decode_base64(Scram#scram.storedkey),
|
||||||
Passwd = jlib:decode_base64(Scram#scram.storedkey),
|
DigRes = if Digest /= <<"">> ->
|
||||||
DigRes = if Digest /= <<"">> ->
|
Digest == DigestGen(Passwd);
|
||||||
Digest == DigestGen(Passwd);
|
true -> false
|
||||||
true -> false
|
end,
|
||||||
end,
|
if DigRes -> true;
|
||||||
if DigRes -> true;
|
true -> (Passwd == Password) and (Password /= <<"">>)
|
||||||
true -> (Passwd == Password) and (Password /= <<"">>)
|
end;
|
||||||
end;
|
_ -> false
|
||||||
_ -> false
|
end
|
||||||
end
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
%% @spec (User::string(), Server::string(), Password::string()) ->
|
%% @spec (User::string(), Server::string(), Password::string()) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user