diff options
author | Badlop <badlop@process-one.net> | 2019-10-02 12:31:04 +0200 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2019-10-02 12:42:59 +0200 |
commit | 949e71efb644f6b79030e26ed880bb2e74b93da0 (patch) | |
tree | 5c48db1d8b9cae2c5d00a974549dee798754ba02 /src | |
parent | Support custom base path in WebAdmin by using relative URLs (#3043) (diff) |
Update Guide links in WebAdmin to website, as local file isn't included
Diffstat (limited to 'src')
-rw-r--r-- | src/ejabberd_web_admin.erl | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/ejabberd_web_admin.erl b/src/ejabberd_web_admin.erl index d16e28206..bc0fc8e7b 100644 --- a/src/ejabberd_web_admin.erl +++ b/src/ejabberd_web_admin.erl @@ -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} = |