CAPTCHA validation?
  • I have added a CAPTCHA to the create user form, because users were being registered with random info.

    The form looks like this:
    <p>{{ user_form template="register.tpl" submit_button="Create User" }}
    <table>
    <tr><td>Name:</td><td>{{ camp_edit object="user" attribute="name" }}</td></tr>
    <tr><td>Username:</td><td>{{ camp_edit object="user" attribute="uname" }}</td></tr>
    <tr><td>Password:</td><td>{{ camp_edit object="user" attribute="password" }}</td></tr>
    <tr><td>Password again:</td><td>{{ camp_edit object="user" attribute="passwordagain" }}</td></tr>
    <tr><td>E-Mail:</td><td>{{ camp_edit object="user" attribute="email" }}</td></tr>
    <tr><td>City:</td><td>{{ camp_edit object="user" attribute="city" }}</td></tr>
    <tr><td>Country:</td><td>{{ camp_select object="user" attribute="country" }}</td></tr>
    <tr><td>Phone:</td><td>{{ camp_edit object="user" attribute="phone" }}</td></tr>
    <tr><td colspan="2"><img src="{{ captcha_image_link }}"></td></tr>
    <tr><td>Code:</td><td>{{ camp_edit object="captcha" attribute="code" }}</td></tr>
    </td><td colspan="2">{{ /user_form }}</td>
    </table>
    </p>
    

    But the "code" field doesn't work. Type in anything or leave it blank, the user will still be registered. How do I validate the CAPTCHA?

    The register.tpl template looks like this:
    {{ if $campsite->edit_user_action->defined }}
    {{ if $campsite->edit_user_action->ok }}
    <p>User registered successfully</p>
    {{ else }}
    <p class="error">Could not add user: {{
    $campsite->edit_user_action->error_message }}</p>
    {{ include file="registerform.tpl" }}
    {{ /if }}
    {{ else }}
    {{ include file="registerform.tpl" }}
    {{ /if }}
    

    (Version: Campsite 3.4.3)
  • 2 Comments sorted by
  • Hi Sebastian, make sure you have captcha enabled for your publication in the publication settings.
  • I enabled "Use CAPTCHA to prevent spam?", but I could still register a user with an incorrect CAPTCHA.