I would like to change AddCommentAction to support captchas. the
changes I'd like to make are as follows:
xwiki-core becomes dependent on xwiki-captcha I don't like it but
xwiki-action is not ready and there is no api for adding comments.
If xpage is defined and xredirect is not and then it does not redirect.
If a user is logged in then author name is taken from the context
and the author field is ignored. This will improve security when
anonymous commenting is disallowed.
If the user is not logged in, captcha service is enabled, and
request parameter: captcha_answer is specified then a captcha
verifier is gotten with hint specified by request parameter
captcha_type and captcha_answer is verified.
If the user is not logged in, captcha service is enabled,
captcha_answer is not specified, and space preference
"guest_comment_requires_captcha" is 1 then captcha verification fails.
If captcha check fails then captchaAnswerWrong = true is placed in
the velocity context and comment isn't added.
Patch is posted here:
http://jira.xwiki.org/jira/secure/attachment/16792/XWIKI-4952-CommentAddAct…
Caleb