From d7250111ce9d07becfdb8848b3d07d57c66e8c48 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Sun, 24 Sep 2017 14:32:37 +0300 Subject: [PATCH] Reuse some translation strings --- src/ejabberd_c2s.erl | 4 ++-- src/ejabberd_s2s.erl | 2 +- src/ejabberd_service.erl | 2 +- src/mod_announce.erl | 10 +++++----- src/mod_configure.erl | 10 +++++----- src/mod_http_upload.erl | 2 +- src/mod_irc.erl | 2 +- src/mod_legacy_auth.erl | 2 +- src/mod_muc_log.erl | 2 +- src/mod_proxy65_service.erl | 4 ++-- src/mod_register.erl | 8 ++++---- src/mod_roster.erl | 2 +- src/mod_s2s_dialback.erl | 2 +- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index fe60f344e..c5af2e031 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -411,7 +411,7 @@ bind(R, #{user := U, server := S, access := Access, lang := Lang, ejabberd_hooks:run(forbidden_session_hook, LServer, [JID]), ?INFO_MSG("(~s) Forbidden c2s session for ~s", [SockMod:pp(Socket), jid:encode(JID)]), - Txt = <<"Denied by ACL">>, + Txt = <<"Access denied by service policy">>, {error, xmpp:err_not_allowed(Txt, Lang), State} end end. @@ -658,7 +658,7 @@ process_presence_out(#{user := User, server := Server, lserver := LServer, MyBareJID = jid:remove_resource(JID), case acl:match_rule(LServer, Access, MyBareJID) of deny -> - ErrText = <<"Denied by ACL">>, + ErrText = <<"Access denied by service policy">>, Err = xmpp:err_forbidden(ErrText, Lang), send_error(State, Pres, Err); allow -> diff --git a/src/ejabberd_s2s.erl b/src/ejabberd_s2s.erl index 7a2bc3a4b..7dd82b804 100644 --- a/src/ejabberd_s2s.erl +++ b/src/ejabberd_s2s.erl @@ -369,7 +369,7 @@ do_route(Packet) -> <<"Server connections to local " "subdomains are forbidden">>, Lang); forbidden -> - xmpp:err_forbidden(<<"Denied by ACL">>, Lang); + xmpp:err_forbidden(<<"Access denied by service policy">>, Lang); internal_server_error -> xmpp:err_internal_server_error() end, diff --git a/src/ejabberd_service.erl b/src/ejabberd_service.erl index dd6310fbe..7b5f945d0 100644 --- a/src/ejabberd_service.erl +++ b/src/ejabberd_service.erl @@ -199,7 +199,7 @@ handle_info({route, Packet}, #{access := Access} = State) -> xmpp_stream_in:send(State, Packet); deny -> Lang = xmpp:get_lang(Packet), - Err = xmpp:err_not_allowed(<<"Denied by ACL">>, Lang), + Err = xmpp:err_not_allowed(<<"Access denied by service policy">>, Lang), ejabberd_router:route_error(Packet, Err), State end; diff --git a/src/mod_announce.erl b/src/mod_announce.erl index 7d25168cc..b259aced9 100644 --- a/src/mod_announce.erl +++ b/src/mod_announce.erl @@ -237,7 +237,7 @@ disco_identity(Acc, _From, _To, Node, Lang) -> -define(INFO_RESULT(Allow, Feats, Lang), case Allow of deny -> - {error, xmpp:err_forbidden(<<"Denied by ACL">>, Lang)}; + {error, xmpp:err_forbidden(<<"Access denied by service policy">>, Lang)}; allow -> {result, Feats} end). @@ -252,7 +252,7 @@ disco_features(Acc, From, #jid{lserver = LServer} = _To, <<"announce">>, Lang) - case {acl:match_rule(LServer, Access1, From), acl:match_rule(global, Access2, From)} of {deny, deny} -> - Txt = <<"Denied by ACL">>, + Txt = <<"Access denied by service policy">>, {error, xmpp:err_forbidden(Txt, Lang)}; _ -> {result, []} @@ -303,7 +303,7 @@ disco_features(Acc, From, #jid{lserver = LServer} = _To, Node, Lang) -> -define(ITEMS_RESULT(Allow, Items, Lang), case Allow of deny -> - {error, xmpp:err_forbidden(<<"Denied by ACL">>, Lang)}; + {error, xmpp:err_forbidden(<<"Access denied by service policy">>, Lang)}; allow -> {result, Items} end). @@ -417,7 +417,7 @@ commands_result(Allow, From, To, Request) -> case Allow of deny -> Lang = Request#adhoc_command.lang, - {error, xmpp:err_forbidden(<<"Denied by ACL">>, Lang)}; + {error, xmpp:err_forbidden(<<"Access denied by service policy">>, Lang)}; allow -> announce_commands(From, To, Request) end. @@ -843,7 +843,7 @@ add_store_hint(El) -> -spec route_forbidden_error(stanza()) -> ok. route_forbidden_error(Packet) -> Lang = xmpp:get_lang(Packet), - Err = xmpp:err_forbidden(<<"Denied by ACL">>, Lang), + Err = xmpp:err_forbidden(<<"Access denied by service policy">>, Lang), ejabberd_router:route_error(Packet, Err). -spec init_cache(module(), binary(), gen_mod:opts()) -> ok. diff --git a/src/mod_configure.erl b/src/mod_configure.erl index 3bb9f2279..31f7a9c80 100644 --- a/src/mod_configure.erl +++ b/src/mod_configure.erl @@ -192,7 +192,7 @@ get_local_identity(Acc, _From, _To, Node, Lang) -> -define(INFO_RESULT(Allow, Feats, Lang), case Allow of - deny -> {error, xmpp:err_forbidden(<<"Denied by ACL">>, Lang)}; + deny -> {error, xmpp:err_forbidden(<<"Access denied by service policy">>, Lang)}; allow -> {result, Feats} end). @@ -310,7 +310,7 @@ get_sm_items(Acc, From, Items ++ Nodes ++ get_user_resources(User, Server)}; {allow, <<"config">>} -> {result, []}; {_, <<"config">>} -> - {error, xmpp:err_forbidden(<<"Denied by ACL">>, Lang)}; + {error, xmpp:err_forbidden(<<"Access denied by service policy">>, Lang)}; _ -> Acc end end. @@ -432,7 +432,7 @@ get_local_items(Acc, From, #jid{lserver = LServer} = To, _ -> LNode = tokenize(Node), Allow = acl:match_rule(LServer, configure, From), - Err = xmpp:err_forbidden(<<"Denied by ACL">>, Lang), + Err = xmpp:err_forbidden(<<"Access denied by service policy">>, Lang), case LNode of [<<"config">>] -> ?ITEMS_RESULT(Allow, LNode, {error, Err}); @@ -765,7 +765,7 @@ get_stopped_nodes(_Lang) -> -define(COMMANDS_RESULT(LServerOrGlobal, From, To, Request, Lang), case acl:match_rule(LServerOrGlobal, configure, From) of - deny -> {error, xmpp:err_forbidden(<<"Denied by ACL">>, Lang)}; + deny -> {error, xmpp:err_forbidden(<<"Access denied by service policy">>, Lang)}; allow -> adhoc_local_commands(From, To, Request) end). @@ -1737,7 +1737,7 @@ adhoc_sm_commands(_Acc, From, action = Action, xdata = XData} = Request) -> case acl:match_rule(LServer, configure, From) of deny -> - {error, xmpp:err_forbidden(<<"Denied by ACL">>, Lang)}; + {error, xmpp:err_forbidden(<<"Access denied by service policy">>, Lang)}; allow -> ActionIsExecute = Action == execute orelse Action == complete, if Action == cancel -> diff --git a/src/mod_http_upload.erl b/src/mod_http_upload.erl index 8d986d0d3..f117434ed 100644 --- a/src/mod_http_upload.erl +++ b/src/mod_http_upload.erl @@ -522,7 +522,7 @@ process_slot_request(#iq{lang = Lang, from = From} = IQ, deny -> ?DEBUG("Denying HTTP upload slot request from ~s", [jid:encode(From)]), - Txt = <<"Denied by ACL">>, + Txt = <<"Access denied by service policy">>, xmpp:make_error(IQ, xmpp:err_forbidden(Txt, Lang)) end. diff --git a/src/mod_irc.erl b/src/mod_irc.erl index 04687ea67..92093507e 100644 --- a/src/mod_irc.erl +++ b/src/mod_irc.erl @@ -262,7 +262,7 @@ do_route(Host, ServerHost, Access, Packet) -> end; deny -> Lang = xmpp:get_lang(Packet), - Err = xmpp:err_forbidden(<<"Denied by ACL">>, Lang), + Err = xmpp:err_forbidden(<<"Access denied by service policy">>, Lang), ejabberd_router:route_error(Packet, Err) end. diff --git a/src/mod_legacy_auth.erl b/src/mod_legacy_auth.erl index 5a4ff9108..722a05738 100644 --- a/src/mod_legacy_auth.erl +++ b/src/mod_legacy_auth.erl @@ -133,7 +133,7 @@ authenticate(#{stream_id := StreamID, server := Server, Err = xmpp:make_error(IQ, xmpp:err_jid_malformed()), process_auth_failure(State, U, Err, 'jid-malformed'); false -> - Txt = <<"Denied by ACL">>, + Txt = <<"Access denied by service policy">>, Err = xmpp:make_error(IQ, xmpp:err_forbidden(Txt, Lang)), process_auth_failure(State, U, Err, 'forbidden') end. diff --git a/src/mod_muc_log.erl b/src/mod_muc_log.erl index 91203530d..cd4e195da 100644 --- a/src/mod_muc_log.erl +++ b/src/mod_muc_log.erl @@ -1059,7 +1059,7 @@ get_roomconfig_text(allow_visitor_status, Lang) -> ?T(<<"Allow visitors to send status text in " "presence updates">>); get_roomconfig_text(captcha_protected, Lang) -> - ?T(<<"Make room captcha protected">>); + ?T(<<"Make room CAPTCHA protected">>); get_roomconfig_text(description, Lang) -> ?T(<<"Room description">>); %% get_roomconfig_text(subject, Lang) -> "Subject"; diff --git a/src/mod_proxy65_service.erl b/src/mod_proxy65_service.erl index aaece980a..4a4729dcf 100644 --- a/src/mod_proxy65_service.erl +++ b/src/mod_proxy65_service.erl @@ -183,7 +183,7 @@ process_bytestreams(#iq{type = get, from = JID, to = To, lang = Lang} = IQ) -> StreamHost = get_streamhost(Host, ServerHost), xmpp:make_iq_result(IQ, #bytestreams{hosts = [StreamHost]}); deny -> - xmpp:make_error(IQ, xmpp:err_forbidden(<<"Denied by ACL">>, Lang)) + xmpp:make_error(IQ, xmpp:err_forbidden(<<"Access denied by service policy">>, Lang)) end; process_bytestreams(#iq{type = set, lang = Lang, sub_els = [#bytestreams{sid = SID}]} = IQ) @@ -232,7 +232,7 @@ process_bytestreams(#iq{type = set, lang = Lang, from = InitiatorJID, to = To, xmpp:make_error(IQ, xmpp:err_internal_server_error(Txt, Lang)) end; deny -> - Txt = <<"Denied by ACL">>, + Txt = <<"Access denied by service policy">>, xmpp:make_error(IQ, xmpp:err_forbidden(Txt, Lang)) end. diff --git a/src/mod_register.erl b/src/mod_register.erl index 61975e8a1..1715a15e4 100644 --- a/src/mod_register.erl +++ b/src/mod_register.erl @@ -127,7 +127,7 @@ process_iq(#iq{from = From, to = To} = IQ, Source) -> process_iq(#iq{type = set, lang = Lang, sub_els = [#register{remove = true}]} = IQ, _Source, _IsCaptchaEnabled, _AllowRemove = false) -> - Txt = <<"Denied by ACL">>, + Txt = <<"Access denied by service policy">>, xmpp:make_error(IQ, xmpp:err_forbidden(Txt, Lang)); process_iq(#iq{type = set, lang = Lang, to = To, from = From, sub_els = [#register{remove = true, @@ -270,7 +270,7 @@ try_register_or_set_password(User, Server, Password, xmpp:make_error(IQ, Error) end; deny -> - Txt = <<"Denied by ACL">>, + Txt = <<"Access denied by service policy">>, xmpp:make_error(IQ, xmpp:err_forbidden(Txt, Lang)) end; _ -> @@ -322,8 +322,8 @@ try_register(User, Server, Password, SourceRaw, Lang) -> case {acl:match_rule(Server, Access, JID), check_ip_access(SourceRaw, IPAccess)} of - {deny, _} -> {error, xmpp:err_forbidden(<<"Denied by ACL">>, Lang)}; - {_, deny} -> {error, xmpp:err_forbidden(<<"Denied by ACL">>, Lang)}; + {deny, _} -> {error, xmpp:err_forbidden(<<"Access denied by service policy">>, Lang)}; + {_, deny} -> {error, xmpp:err_forbidden(<<"Access denied by service policy">>, Lang)}; {allow, allow} -> Source = may_remove_resource(SourceRaw), case check_timeout(Source) of diff --git a/src/mod_roster.erl b/src/mod_roster.erl index 7bc5f7de7..c03ea1154 100644 --- a/src/mod_roster.erl +++ b/src/mod_roster.erl @@ -184,7 +184,7 @@ process_local_iq(#iq{type = set, from = From, lang = Lang, Access = gen_mod:get_module_opt(Server, ?MODULE, access, all), case acl:match_rule(Server, Access, From) of deny -> - Txt = <<"Denied by ACL">>, + Txt = <<"Access denied by service policy">>, xmpp:make_error(IQ, xmpp:err_not_allowed(Txt, Lang)); allow -> process_iq_set(IQ) diff --git a/src/mod_s2s_dialback.erl b/src/mod_s2s_dialback.erl index ab33597a5..403ac9cce 100644 --- a/src/mod_s2s_dialback.erl +++ b/src/mod_s2s_dialback.erl @@ -320,7 +320,7 @@ check_from_to(From, To) -> -spec mk_error(term()) -> stanza_error(). mk_error(forbidden) -> - xmpp:err_forbidden(<<"Denied by ACL">>, ?MYLANG); + xmpp:err_forbidden(<<"Access denied by service policy">>, ?MYLANG); mk_error(host_unknown) -> xmpp:err_not_allowed(<<"Host unknown">>, ?MYLANG); mk_error({codec_error, Why}) ->