summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2011-03-03 00:02:28 +0100
committerBadlop <badlop@process-one.net>2011-03-03 00:02:43 +0100
commite0d14c3b8d84f5249e388844f7901fed88b18209 (patch)
tree15c506d91bcf26dd3e21e55f2c1fe40bc9ff3e90
parentmod_irc must send presence unavailable to the departing occupant (EJAB-1417) (diff)
captcha_host must have the port number to get protocol (EJAB-1418)
-rw-r--r--doc/guide.tex10
-rw-r--r--src/ejabberd.cfg.example2
-rw-r--r--src/ejabberd_captcha.erl4
3 files changed, 8 insertions, 8 deletions
diff --git a/doc/guide.tex b/doc/guide.tex
index 2bacd57c..c51baca9 100644
--- a/doc/guide.tex
+++ b/doc/guide.tex
@@ -1633,11 +1633,11 @@ The configurable options are:
\titem{\{captcha\_cmd, Path\}}
Full path to a script that generates the image.
The default value is an empty string: \term{""}
- \titem{\{captcha\_host, Host\}}
- Host part of the URL sent to the user.
- You can include the port number.
- The URL sent to the user is formed by: \term{http://Host/captcha/}
- The default value is the first hostname configured.
+ \titem{\{captcha\_host, HostPort\}}
+ Host part of the URL sent to the user,
+ and the port number where ejabberd listens for CAPTCHA requests.
+ The URL sent to the user is formed by: \term{http://Host:Port/captcha/}
+ The default value is: the first hostname configured, and port 5280.
\end{description}
Additionally, an \term{ejabberd\_http} listener must be enabled with the \term{captcha} option.
diff --git a/src/ejabberd.cfg.example b/src/ejabberd.cfg.example
index 52ffc682..0912bf55 100644
--- a/src/ejabberd.cfg.example
+++ b/src/ejabberd.cfg.example
@@ -475,7 +475,7 @@
%%{captcha_cmd, "/lib/ejabberd/priv/bin/captcha.sh"}.
%%
-%% Host part of the URL sent to the user.
+%% Host for the URL and port where ejabberd listens for CAPTCHA requests.
%%
%%{captcha_host, "example.org:5280"}.
diff --git a/src/ejabberd_captcha.erl b/src/ejabberd_captcha.erl
index 455ffad9..0f3aee76 100644
--- a/src/ejabberd_captcha.erl
+++ b/src/ejabberd_captcha.erl
@@ -406,12 +406,12 @@ get_prog_name() ->
get_url(Str) ->
CaptchaHost = ejabberd_config:get_local_option(captcha_host),
- TransferProt = atom_to_list(get_transfer_protocol(CaptchaHost)),
case CaptchaHost of
Host when is_list(Host) ->
+ TransferProt = atom_to_list(get_transfer_protocol(CaptchaHost)),
TransferProt ++ "://" ++ Host ++ "/captcha/" ++ Str;
_ ->
- TransferProt ++ "://" ++ ?MYNAME ++ "/captcha/" ++ Str
+ "http://" ++ ?MYNAME ++ ":5280/captcha/" ++ Str
end.
get_transfer_protocol(CaptchaHost) ->