]> granicus.if.org Git - ejabberd/commitdiff
Update Guide links in WebAdmin to website, as local file isn't included
authorBadlop <badlop@process-one.net>
Wed, 2 Oct 2019 10:31:04 +0000 (12:31 +0200)
committerBadlop <badlop@process-one.net>
Wed, 2 Oct 2019 10:42:59 +0000 (12:42 +0200)
include/ejabberd_web_admin.hrl
src/ejabberd_web_admin.erl

index 9700ab0b349707309f6dee270ea9fda25fcc5102..7310870540aee5ed54c69af43a46c7946fbe4ba5 100644 (file)
@@ -93,7 +93,7 @@
 -define(GL(Ref, Title),
        ?XAE(<<"div">>, [{<<"class">>, <<"guidelink">>}],
             [?XAE(<<"a">>,
-                  [{<<"href">>, <<"/admin/doc/guide.html#", Ref/binary>>},
+                  [{<<"href">>, <<"https://docs.ejabberd.im/admin/configuration/#", Ref/binary>>},
                    {<<"target">>, <<"_blank">>}],
                   [?C(<<"[Guide: ", Title/binary, "]">>)])])).
 
index d16e28206d4d112da06250b6b0688fd3d5b47656..bc0fc8e7b81b32ea9470678c0f7da8f174cd6716 100644 (file)
@@ -150,30 +150,6 @@ url_to_path(URL) -> str:tokens(URL, <<"/">>).
 %%%==================================
 %%%% process/2
 
-process([<<"doc">>, LocalFile], _Request) ->
-    DocPath = case os:getenv("EJABBERD_DOC_PATH") of
-               P when is_list(P) -> P;
-               false -> <<"/share/doc/ejabberd/">>
-             end,
-    FileName = filename:join(DocPath, LocalFile),
-    case file:read_file(FileName) of
-      {ok, FileContents} ->
-         ?DEBUG("Delivering content.", []),
-         {200, [{<<"Server">>, <<"ejabberd">>}], FileContents};
-      {error, Error} ->
-         Help = <<" ", FileName/binary,
-                  " - Try to specify the path to ejabberd "
-                  "documentation with the environment variable "
-                  "EJABBERD_DOC_PATH. Check the ejabberd "
-                  "Guide for more information.">>,
-         ?WARNING_MSG("Problem '~p' accessing the local Guide file ~ts", [Error, Help]),
-         case Error of
-           eacces -> {403, [], <<"Forbidden", Help/binary>>};
-           enoent -> {307, [{<<"Location">>, <<"http://docs.ejabberd.im/admin/guide/configuration/">>}], <<"Not found", Help/binary>>};
-           _Else ->
-               {404, [], <<(iolist_to_binary(atom_to_list(Error)))/binary, Help/binary>>}
-         end
-    end;
 process([<<"server">>, SHost | RPath] = Path,
        #request{auth = Auth, lang = Lang, host = HostHTTP,
                 method = Method} =