PLEASE HELP - REALLY STUCK
I am trying to get a captcha field to verify
I have (I think) fully carried out step 1 from Sachin's reply in the file
registerinline.vm in my xwiki. The captcha field appears with an input box.
I now want to add part 2 - but I can't work out where to put the code (is it
in the same vm file, and if not which one?). Sachin says "For Validation in
the vm file that is called from "verifyCaptcha" action
add the following:" - but I can't work out which vm file to put it in.
Sachin Mittal wrote:
Following is needed to get the Captcha working on say user registration
page:
1. For display
inside the form that submits the user registration information add the
following:
<form action="verifyCaptcha" >
...
## declare the plugin
#set($captchaPlugin = $xwiki.jcaptcha)
#if ($captchaPlugin)
##call the displayCaptcha pass the class name as "register_captcha" which
should map to the css classname to render the image
##pass the name as edit
##and under
http://<host>:<port>/xwiki/bin/edit/XWiki/XWikiPreferences?editor=object&
##under XWiki.XWikiPreferences[0]: XWiki.DefaultSkin select the values for
Anonymous: and Registered: as image or text
$captchaPlugin.displayCaptcha("edit","register_captcha")
#end
...
</form>
2. For Validation in the vm file that is called from "verifyCaptcha"
action
add the following:
## declare the plugin
#set($captchaPlugin = $xwiki.jcaptcha)
#if ($captchaPlugin)
##call the verifyCaptcha
#if($captchaPlugin.verifyCaptcha("edit"))
##register the user
#$xwiki.createUser(false)
#else
##display some error
#error("$msg.get('core.register.registerFailed', [$reg])")
#end
#end
*note: by default in register use the RegisterAction is called which by
default does not verify captcha. However same is done in other actions
like PreviewAction,CommentAddAction and SaveAction.
Again all this may not be easy for users of xwiki as to add Captcha to
registration page progmaing knowledge is required.
Thanks
Sachin
--
View this message in context:
http://n2.nabble.com/CAPTCHA-for-comments-and-registration-tp507976p3212461…
Sent from the XWiki- Users mailing list archive at
Nabble.com.