mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01:00
Merge branch 'master' of github.com:processone/ejabberd
This commit is contained in:
commit
17f9ffb7e7
@ -1161,7 +1161,7 @@ get_form(_Host, ?NS_ADMINL(<<"get-user-password">>),
|
||||
get_form(_Host, ?NS_ADMINL(<<"change-user-password">>),
|
||||
Lang) ->
|
||||
{result,
|
||||
#xdata{title = ?T(Lang, <<"Get User Password">>),
|
||||
#xdata{title = ?T(Lang, <<"Change User Password">>),
|
||||
type = form,
|
||||
fields = [?HFIELD(),
|
||||
#xdata_field{type = 'jid-single',
|
||||
|
@ -94,7 +94,7 @@ remove_old_messages(Days, LServer) ->
|
||||
ejabberd_sql:sql_query_t(
|
||||
?SQL("DELETE FROM spool"
|
||||
" WHERE created_at <"
|
||||
" NOW() - INTERVAL '%(Days)d DAY'"));
|
||||
" NOW() - %(Days)d * INTERVAL '1 DAY'"));
|
||||
(_, _) ->
|
||||
ejabberd_sql:sql_query_t(
|
||||
?SQL("DELETE FROM spool"
|
||||
|
@ -429,18 +429,26 @@ mk_search_form(JID, ServerHost, Lang) ->
|
||||
Fs = [mk_tfield(Label, Var, Lang) || {Label, Var} <- SearchFields],
|
||||
X = #xdata{type = form,
|
||||
title = Title,
|
||||
instructions =
|
||||
[translate:translate(
|
||||
Lang,
|
||||
<<"Fill in the form to search for any matching "
|
||||
"Jabber User (Add * to the end of field "
|
||||
"to match substring)">>)],
|
||||
instructions = [make_instructions(Mod, Lang)],
|
||||
fields = Fs},
|
||||
#search{instructions =
|
||||
translate:translate(
|
||||
Lang, <<"You need an x:data capable client to search">>),
|
||||
xdata = X}.
|
||||
|
||||
make_instructions(Mod, Lang) ->
|
||||
Fill = translate:translate(
|
||||
Lang,
|
||||
<<"Fill in the form to search for any matching "
|
||||
"Jabber User">>),
|
||||
Add = translate:translate(
|
||||
Lang,
|
||||
<<" (Add * to the end of field to match substring)">>),
|
||||
case Mod of
|
||||
mod_vcard_mnesia -> Fill;
|
||||
_ -> str:concat(Fill, Add)
|
||||
end.
|
||||
|
||||
-spec search_result(binary(), jid(), binary(), [xdata_field()]) -> xdata().
|
||||
search_result(Lang, JID, ServerHost, XFields) ->
|
||||
Mod = gen_mod:db_mod(ServerHost, ?MODULE),
|
||||
|
Loading…
Reference in New Issue
Block a user