IQ#iq{type = error,
sub_el = [SubEl, ?ERR_INTERNAL_SERVER_ERROR]}
end;
+ error_preparing_password ->
+ ErrText = <<"The password contains unacceptable characters">>,
+ IQ#iq{type = error,
+ sub_el = [SubEl, ?ERRT_NOT_ACCEPTABLE(Lang, ErrText)]};
false ->
ErrText = <<"The password is too weak">>,
IQ#iq{type = error,
{error, ?ERR_INTERNAL_SERVER_ERROR}
end
end;
+ error_preparing_password ->
+ remove_timeout(Source),
+ ErrText = <<"The password contains unacceptable characters">>,
+ {error, ?ERRT_NOT_ACCEPTABLE(Lang, ErrText)};
false ->
remove_timeout(Source),
ErrText = <<"The password is too weak">>,
end.
is_strong_password(Server, Password) ->
+ case jid:resourceprep(Password) of
+ PP when is_binary(PP) ->
+ is_strong_password2(Server, Password);
+ error ->
+ error_preparing_password
+ end.
+
+is_strong_password2(Server, Password) ->
LServer = jid:nameprep(Server),
case gen_mod:get_module_opt(LServer, ?MODULE, password_strength,
fun(N) when is_number(N), N>=0 -> N end,