Search

A new Extension, “reCAPTCHA” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

reCAPTCHA helps prevent automated abuse of your site (such as comment spam or bogus registrations) by using a CAPTCHA to ensure that only humans perform certain actions.

Be sure to read the README.txt for installation and usage information.

Get the latest version from git http://github.com/pointybeard/recaptcha/tree/master

Requires Symphony Beta Revision 5 or later

sweet. been getting lots of spam from my contact form. thanks alistair!

Thank you, definately can use this one!

well, took me over a week to figure this out, but to add this to a message form, you just need to create the recaptcha event and then add it to the Save Message event.

and be sure to read up on the api docs: http://recaptcha.net/apidocs/captcha/client.html. mainly, you need to remember to put in the javascript blocks inside the <form> element.

edit.
seems like the recaptcha isn't working with this 100%. if the user doesn't fill in the captcha, an error is thrown. if a value is entered in but doesn't match the captcha, it goes through as correct. so still trying to figure this out.

update.
well, even though if you enter the wrong captcha, it seems to have stopped my spam i was receiving. i think the issue might that if you're close to the captcha, then it still works for some reason. when i checked my mail this morning, there was no spam whatsoever in there!

I have put this extension under git version control

I wonder if this works with the email template filter.

The Email Template Filter uses an "Expression" in the condition to choose whether to send the email. If the reCAPTCHA fails then the entry won't be created, therefore the condition isn't met and the email not sent. In theory anyway!

The way to find out would be to try :-)

When I add the reCaptcha Verification filter to a register event reCaptcha indicates the following as an example of what I should expect to see in my xml after submitting the form:

<filter type="recaptcha" status="passed" />
<filter type="recaptcha" status="failed">Challenge words entered were invalid.</filter>

However, I don’t see any such feedback xml at all upon successful or unsuccessful submissions even the event specific feedback such as:

<register result="error">
  <message>Entry encountered errors when saving.</message>
  <field-name type="invalid | missing" />
  ...
</register>

What am I doing wrong? Have I given you enough information to evaluate this? Any known issues?

Do you have the following in the config?

    'public' => array(
        'display_event_xml_in_source' => 'yes',
    ),

@Lewis Thanks for your reply.

Yes my config has:

    ###### PUBLIC ######
    'public' => array(
        'display_event_xml_in_source' => 'yes',
    ),

Before attempting to submit the form on my registration page my ?debug=xml looks like this:

<?xml version="1.0" encoding="utf-8" ?>
2   <data>
3   <events>
4      <fmm-status status="ok" />
5   </events>
6   <breadcrumb>
7      <page path="login">Login</page>
8      <page path="login/register">Register</page>
9   </breadcrumb>
10  <recaptcha>6Ld46ggAAAAAADo4GVS-2tLb27xoc_mNMnXSP0s0 </recaptcha>
11  <section>
12     <section id="4" handle="sections">Sections</section>
13     <error>No records found.</error>
14  </section>
15  </data>

After I submit the form the ?debug=xml looks like this:

<?xml version="1.0" encoding="utf-8" ?>
2   <data>
3   <events>
4     <fmm-status status="ok" />
5   </events>
6   <breadcrumb>
7     <page path="login">Login</page>
8     <page path="login/register">Register</page>
9   </breadcrumb>
10  <recaptcha>6Ld46ggAAAAAADo4GVS-2tLb27xoc_mNMnXSP0s0 </recaptcha>
11  <section>
12    <section id="4" handle="sections">Sections</section>
13    <error>No records found.</error>
14  </section>
15  </data>

I do not know if this is related to reCaptcha or not; however, the XML for the event is generating but is not showing up in the ?debug=xml page.

I filed a bug report via github.

Here is the XSL that tested positive for the invisible events/register XML:

                <xsl:when test="/data/events/register/@result='error'">
                <xsl:call-template name="status-feedback">
                    <xsl:with-param name="action"
                        select="'There was an unidentified error with your registration.'" />
                </xsl:call-template>
            </xsl:when>

I also created this test:

        <xsl:if test="$cookie-username = 'webmaster'">
            <xsl:apply-templates select="/data/events/register" mode="error-report"/>
        </xsl:if>

Which runs an XSL stylesheet and gives me this feedback (pictured below):

reCaptcha Results

Resolved

Embarrassing. The more I use Symphony the more I learn. Thanks, Alistair for your help.

For anyone that has this sort of trouble, please do the following:

  1. Locate the file /manifest/config.php
  2. On about Line 64 you’ll see this code:

    ###### PUBLIC ######

    ‘public’ => array( ‘display_event_xml_in_source’ => ‘yes’, ),

    ########

  3. Make sure that the value for display_event_xml_in_source is 'yes'

  4. Then go to the page that reCaptcha or any event that fires after posting a form, once you’ve posted the form that result page will contain an HTML comment block at the bottom of it that shows the /data/events node of the XML driving the page.

Code Example:

<events>
    <register result="error">
        <filter name="recaptcha" status="failed">Challenge words entered were invalid.</filter>
        <post-values>
            <first-name>Will</first-name>
            <last-name>Nielsen</last-name>
            <address>123 Test Address</address>
            <city>Dallas</city>
            <state>TX</state>
            <zip-code>75081</zip-code>
            <phone>555-555-5555</phone>
            <email>wjnielsen@gmail.com</email>
            <password>cheechandchong</password>
            <password-2>cheechandchong</password-2>
            <type>Client</type>
            <active>Yes</active>
            <date-added>2009-10-21 09:36</date-added>
            <record-origin>User Entered on Website</record-origin>
        </post-values>
        <message>Entry encountered errors when saving.</message>
    </register>
</events>

Key to remember

When you submit the form the event fires successfully or it fails. When one then types ?debug in the url it loads the page again which causes the resultant event XML to change because the reCaptcha event only fires on submission of the form on a page to which it is associated.

Alistair suggested that one could also for development purposes direct the form action to someurl.com/your-page/?debug=xml which would post the form to the debug page and the XML would show up in the debugging console.

I’ve wasted about 30 minutes trying to get the editor to display the xml (and the post). I’m sorry it does not display hierarchically here; however, at least it displays now!

wjnielson: I’ve fixed up your post.

Regarding the code blocks for the forum: It seems to have trouble when you have a code block right after a number list. I still have to investigate if the error is Markdown or caused elsewhere.

@allen Thanks! Now I just need you to fix up some of my programming. :-)

I just posted a utility, dependent on this extension that allows one to set reCaptcha themes and tabindex attributes.

Get the reCaptcha Utility

Please make all comments about the utility on the reCaptcha Utility discussion thread.

why would my recaptcha node not be showing up in my data source? I have the event and added it to my page, private/public keys set, but it’s still not showing up so then i get an “invalid key” error since the xpath is looking for /data/recaptcha. I’ve used this in the past and has worked fine, but not sure why this isn’t showing up now.

I’ve added reCaptcha and reCaptcha Utility to my 2.1.2 site and it’s breaking the xml (debug) output on the pages/sections i’ve included it in. it works - but other functionality on my site breaks due to the addition of it. also the error response

Fatal error: Maximum function nesting level of '100' reached, aborting! in //workspace/project/build/symphony/lib/toolkit/class.xmlelement.php on line 35 Call Stack: 0.0005 659696 1. {main}() //workspace/project/build/index.php:0 0.0475 6481304 2. Frontend->display() //workspace/project/build/index.php:25 0.0504 6553968 3. FrontendPage->generate() //workspace/project/build/symphony/lib/core/class.frontend.php:50 0.2716 10352712 4. Content_DebugDevKit_Debug->build() //workspace/project/build/symphony/lib/toolkit/class.frontendpage.php:129 0.2717 10360144 5. DevKit->build() //workspace/project/build/extensions/debugdevkit/content/content.debug.php:47 0.2727 10432056 6. Content_DebugDevKit_Debug->buildJump() //workspace/project/build/symphony/lib/toolkit/class.devkit.php:150 0.2730 10475168 7. Content_DebugDevKit_Debug->__buildUtilityList() //workspace/project/build/extensions/debugdevkit/content/content.debug.php:73

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details