Memorial Day
Support will be closed on Monday, May 28th, 2012 to enjoy Memorial Day with our friends and families.
   
1 of 2
1
reCAPTCHA for register page in EE 1.6.9
Posted: 10 September 2010 10:37 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  05-04-2007

Not sure if this is the correct area to post this. My apologies if it is not.

Brandon Jones wrote a great extension reCAPTCHA for EE2 (http://expressionengine.com/archived_forums/viewthread/153152/). There was talk about sconverting the extension to EE 1.6.9 and as I didn’t see this done yet, I converted it!

Any one who is interested in this extension, it is pretty Beta, but it does work on mysites, I have attached it to this post. Please follow the same instructions from Brandon

Installation

1. Unzip and place the ‘ext.recaptcha.php’ and recaptchalib folder in /system/extensions

2. Place the ‘lang.recaptcha.php’ in /system/language/english

3. From the control panel, click Admin > Utilities > Extensions and enable the reCAPTCHA extension

4. Click the Settings link and enter your domain’s Public and Private reCAPTCHA keys.

5. Remove the hard-coded captcha input field from your member registration template (/themes/profile_themes/[theme_name]/registration_form.html) and any comment submission form templates so that the captcha {if} looks something like:

{if captcha}
  {captcha}
{/if}

ToDo: Not all the settings field show the labels. I have not figured out why.

 Signature 

James Riordon | Out of Control®
Website Development & Maintenance | Montreal, Canada

Profile
 
 
Posted: 10 September 2010 01:52 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  26092
Joined  05-14-2004

Hi, James -

I have moved this to Community News and removed the attachment as per our Guidelines.  Please find a different way to distribute these files.

Thank you!

 Signature 
Profile
MSG
 
 
Posted: 10 September 2010 02:04 PM   [ Ignore ]   [ # 2 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

I had already tried converting this but couldn’t get it to work for some reason (EE didn’t recognize the reCaptcha field as a captcha field, apparently, so I would always get an error message). I actually had added a couple extra things to my version:

1) The ability to set the API keys in your config.php file (for server portability between environments Eg:

$conf['recaptcha_api_public'"yourreallylongPUBLICkeyhere1234567890";
$conf['recaptcha_api_private'"yourreallylongPRIVATEkeyhere1234567890"

2) Made the radio-button settings into dropdowns, because I couldn’t get the labels to show, either. I also defaulted the theme to “clean”.

If I install this version and it works for registrations, I’ll probably re-apply my two updates, and I could send you the updates. This is technically Brandon Jones’ work, so I’m not sure how he feels about re-distributing an EE 1.x version.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 10 September 2010 02:43 PM   [ Ignore ]   [ # 3 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

James: very soon (probably as close as next week) you will be able to post a file like this on devot:ee. We have an interesting forum implementation coming up and we could do all the discussion there as well.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 11 September 2010 01:39 AM   [ Ignore ]   [ # 4 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

James, have you actually tried this? I’m getting the same error as when I converted it myself. I can’t seem to get EE to recognize the reCaptcha field as a captcha field. I get the same error every time.

A captcha image is required in order to register.

I’ve tried everything I can think of, but can’t get this to work.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 11 September 2010 02:28 AM   [ Ignore ]   [ # 5 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

I figured out that it doesn’t seem to work with the register form used by Solspace’s User module...go figure. Works great with the built in registration form, but not with the version of User I have installed. Off to the Solspace forums I guess.

Thanks for your work on this.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 13 September 2010 10:41 AM   [ Ignore ]   [ # 6 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  05-04-2007

Hi,

Sorry for the late replies. I didn’t see the response to this thread in my inbox til now.  long face

I have User also, though not installed. If I can find some time today I will take a look to see if I can find a conflict. Perhaps it is just a matter of what order the extensions are called in?

 Signature 

James Riordon | Out of Control®
Website Development & Maintenance | Montreal, Canada

Profile
 
 
Posted: 13 September 2010 10:49 AM   [ Ignore ]   [ # 7 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

Extension priority was my thought as well, although I looked in the User module and don’t see where it does anything to/for the member_member_register_start hook. I’m not sure that’s an issue, just an observation. If you have any time to take a look that would be great.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 16 September 2010 03:25 PM   [ Ignore ]   [ # 8 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

Greg Ferrell of Solspace got this to work with the User module by adding a hook to exp.recaptcha.php:

$DB->query(
    
$DB->insert_string(
        
'exp_extensions',
        array(
            
'extension_id' => '',
            
'class'        => 'Recaptcha',
            
'method'       => 'validate_captcha',
            
'hook'         => 'user_register_start',
            
'settings'     => '',
            
'priority'     => 1,
            
'version'      => $this->version,
            
'enabled'      => 'y'
        
)
    )
); 

See the thread on the Solspace forums.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 16 September 2010 05:17 PM   [ Ignore ]   [ # 9 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  05-04-2007

Excellent news! Thank you for sharing that.

The only other downside I have in the extension is that the languages for the radio buttons are not showing. Not sure where I went wrong there, and I can’t seem to find the solution.

http://yfrog.com/2mhnwp

 Signature 

James Riordon | Out of Control®
Website Development & Maintenance | Montreal, Canada

Profile
 
 
Posted: 16 September 2010 05:26 PM   [ Ignore ]   [ # 10 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  05-04-2007

Saw your tweet. Changed the radio buttons to selects and all is fine. Thank you again.

Will you be pushing this to devot-ee or should I push it to my github?

 Signature 

James Riordon | Out of Control®
Website Development & Maintenance | Montreal, Canada

Profile
 
 
Posted: 16 September 2010 05:57 PM   [ Ignore ]   [ # 11 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

After talking with another developer about the radio buttons, we believe it’s a bug in EE 1.6 where the labels for the radio items aren’t output. The other thing I would like to be able to do is store my API settings in the config.php file rather than the DB, but I can’t fully figure that out.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 17 September 2010 09:21 AM   [ Ignore ]   [ # 12 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  05-04-2007

To clarify:

Would you want to manually enter the API settings into the config file, or have the settings form place them into the config file?

 Signature 

James Riordon | Out of Control®
Website Development & Maintenance | Montreal, Canada

Profile
 
 
Posted: 17 September 2010 09:57 AM   [ Ignore ]   [ # 13 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1757
Joined  03-26-2006

I need the option to add the settings to the config file and have the extension read them from there, if they exist. This way, if I have multiple server environments (and I do), I can set the API keys to my dev keys for the staging server in config.php, and then set the live keys in the config.php file on the live site - I never have to go into the CP to change these values.

I’ve got part of this down. In the extension, I set the keys to look at the config.php file for two variables:

function settings()
{    
    
global $PREFS;
        
    
$settings = array();

    
$settings['public_key'= isset($PREFS->core_ini['recaptcha_api_public']) ? $PREFS->core_ini['recaptcha_api_public'''
    
$settings['private_key'= isset($PREFS->core_ini['recaptcha_api_private']) ? $PREFS->core_ini['recaptcha_api_private'''
    
$settings['language'= array('s', array('en' => 'English''nl' => 'Dutch''fr' => 'French''de' => 'German''pt' => 'Portuguese''ru' => 'Russian''es' => 'Spanish''tr' => 'Turkish'), 'en');
    
$settings['theme'= array('s', array('red' => "Red"'white' => "White"'blackglass' => "Black Glass"'clean' => "Clean"), 'clean');
    
$settings['debug']= array('s', array('n' => "Don't Show"'y' => "Show"), 'n');
        
  return 
$settings;

Then in config.php I add:

# dev server keys
$conf['recaptcha_api_public'"6LfjPboSAAAAAAKu06a1234567890gOkOK";
$conf['recaptcha_api_private'"6LfjPboSAAAAAGg6N7NpM12345678901IpdQjE"

When I enable the extension, it looks and sees those values there and populates the settings form. The problem is that I can still change the value in the CP and save that. Alternatively, I can edit the config.php file later and the change isn’t reflected if I look at the values in the CP. So what I have works for initially setting the settings.

I think what’s needed is a _get_settings() function when the CP page loads so it re-checks whether there are values in the config.php file. I have a function like that in some other add-ons. I think I can probably reference Jason Ferrell’s Geotagger extension to see what’s going on there and apply it here.

If I get some time this afternoon, I might take a look at this again.

 Signature 

ryan masuga
—————
Masuga Design | devot:ee
@masuga | @masugadesign | @devot_ee

Profile
 
 
Posted: 26 February 2011 12:54 AM   [ Ignore ]   [ # 14 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  575
Joined  03-18-2007

I’m having the webkit caching problem mentioned here:

http://expressionengine.com/archived_forums/viewreply/742188/

The problem is with Chrome. It works fine in Safari. When the user goes “back” after getting it wrong, the reCAPTCHA is the same but it’s obviously expecting a new one.

Thanks for the great work on this.

-Matt

 Signature 

Follow me on Twitter: twitter.com/mrw

Note: I used to be slapshotw on this forum.

Profile
 
 
Posted: 30 December 2011 09:49 PM   [ Ignore ]   [ # 15 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  502
Joined  07-31-2007

I’m trying to get this to work on EE 1.7.1 forum module (the registration is in /themes/forum_themes/default/theme_member.php

reCaptcha shows up fine but I’m getting a constant “You must submit the word that appears in the image” whatever I do. Is there something that needs to be changed to get this extension to work for the forum registration form?

Thanks!

 Signature 

——————————————————-
Perfection is not when there is nothing to add, but when there is nothing to take away.

Profile
 
 
Posted: 31 December 2011 12:20 PM   [ Ignore ]   [ # 16 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  05-04-2007

I dug around and found a site I maintain that still uses this reCaptcha. Although we have the forum registration disabled and redirecting to a single registration point using Solspace’s registratin module, I re-enabled the forum registration page temporarily, and it does work successfully.. still smile

I’ve sent you a PM with a download link to a modified reCaptcha that I am using. It is not the latest version of the script, but I know it works in EE 1.7.1 with the latest forums module for EE 1.7.1.

I compared my register forum template with a virgin sample and they appear identical. Hopefully this will work for you. I’ve a nagging feeling that I had to do something slightly different to get the registrations to work in the forums. Sadly, I didn’t document it.

 Signature 

James Riordon | Out of Control®
Website Development & Maintenance | Montreal, Canada

Profile
 
 
Posted: 31 December 2011 12:58 PM   [ Ignore ]   [ # 17 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  502
Joined  07-31-2007

That’s awesome, thanks a lot for your help! But I don’t see any new PM in my inbox… You sure you sent it to me? You can email me too if more convenient:

http://minimaldesign.net/contact

Thanks again!

 Signature 

——————————————————-
Perfection is not when there is nothing to add, but when there is nothing to take away.

Profile
 
 
Posted: 31 December 2011 02:29 PM   [ Ignore ]   [ # 18 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  246
Joined  05-04-2007

Oops, closed the window before PMing. I’ve sent you an email with the whereabouts of the file. Hopefully you get.

 Signature 

James Riordon | Out of Control®
Website Development & Maintenance | Montreal, Canada

Profile
 
 
   
1 of 2
1