CB goes Captcha!

16 years 11 months ago #35324 by dartagnan
Replied by dartagnan on topic Re:CB goes Captcha!
Hello,

I installed captcha with joomla 1.0.12. and CB1.0.2
No major problem except recently, one user can't see the image displayed by captcha and this on 2 computers, at work and at home, apparently using IE6.
As this is the only person with the problem I don't understand what happens. Why only her can't see this image? I'm afraid it could happen with other people... (To note this person is from China but the other users as well and have no problem)
The website is www.asian-addict.com


thanks for any help

Planet Asia Asian tradition culture and community

Please Log in to join the conversation.

16 years 11 months ago #35345 by spacewalk
Replied by spacewalk on topic Re:Invalid Security Code
I get the captcha image just fine. But whenever I try to register a new user for the site, I get the error "Invalid Security Code."

If I disable "registration" in the plugin back-end, I still get this error during registration.

The only fix is to unpublish the plug-in.

Do we know anything about this scenario? I'd love to use the captcha plug-in.

Please Log in to join the conversation.

16 years 11 months ago #35354 by nant
Replied by nant on topic Re:Invalid Security Code
spacewalk wrote:

I get the captcha image just fine. But whenever I try to register a new user for the site, I get the error "Invalid Security Code."

If I disable "registration" in the plugin back-end, I still get this error during registration.

The only fix is to unpublish the plug-in.

Do we know anything about this scenario? I'd love to use the captcha plug-in.


did you read the rest of this thread ?

it mentions one known case that this happens.

Please Log in to join the conversation.

16 years 11 months ago #35381 by simk318
Replied by simk318 on topic Re:CB goes Captcha!
i have similar type of configuration still doesn't work

Joomla! Register Globals Emulation: OFF
Register Globals: OFF
Magic Quotes: ON
Safe Mode: OFF
File Uploads: ON
Session auto start: OFF
Session save path: none
Short Open Tags: ON
Output Buffering: OFF
Open basedir: none
Display Errors: ON
XML enabled: Yes
Zlib enabled: Yes
Disabled Functions: none


Joomla! 1.0.12 Stable [ Sunfire ] 25 December 2006 01:00 UTC
Apache/1.3.37 (Unix) PHP/5.1.4 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a


please help

Please Log in to join the conversation.

16 years 11 months ago #35384 by spacewalk
Replied by spacewalk on topic Re:CB goes Captcha!
Nick A. was correctly chastising me for not reading the entire thread. (I did read a lot of it, Nick. It's just a really long thread!) :)

Are you using the JSMF bridge for the SMF forum software? If so, you have to go into SMF admin and disable "use database for sessions."

If you're not using JSMF, I have no idea what's wrong.

As a sidenote, this issue (plus being reminded that Joomlapolis itself uses Joomlaboard) finally caused me to abandon JSMF and go with Joomlaboard for a site forum. JSMF is a heroic piece of work, but I've had it with bridges and patching core Joomla files.

I hadn't used Joomlaboard in more than a year. It's not bad at all.



simk318 wrote:

i have similar type of configuration still doesn't work

Joomla! Register Globals Emulation: OFF
Register Globals: OFF
Magic Quotes: ON
Safe Mode: OFF
File Uploads: ON
Session auto start: OFF
Session save path: none
Short Open Tags: ON
Output Buffering: OFF
Open basedir: none
Display Errors: ON
XML enabled: Yes
Zlib enabled: Yes
Disabled Functions: none


Joomla! 1.0.12 Stable [ Sunfire ] 25 December 2006 01:00 UTC
Apache/1.3.37 (Unix) PHP/5.1.4 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a


please help

Please Log in to join the conversation.

16 years 11 months ago #35409 by phlux0r
Replied by phlux0r on topic Re:CB goes Captcha!
Hack to use the cb Captcha on the Joomla Contact form

This worked for me, your experience may vary. ;)

Joomla version 1.0.12
CB version: 1.0.2
CB Captcha plugin version: 1.0 (14.Feb.2007)

Files to hack:
    /components/com_comprofiler/plugin/user/plug_cbcaptcha/cb.captcha.php
    /components/com_contact/contact.html.php
    /components/com_contact/contact.php


1. cb.captcha.php
Since we're using the plugin code outside of the CB plugin framework we need to put all the $_PLUGINS->registerFunction() calls in an if statement like so:
[code:1]if ($_PLUGINS) {
$_PLUGINS->registerFunction( 'onBeforeRegisterForm', 'onBeforeRegisterForm', 'getcaptchaTab' );
$_PLUGINS->registerFunction( 'onBeforeUserRegistration','onBeforeUserRegistration', 'getcaptchaTab' );

$_PLUGINS->registerFunction( 'onLostPassForm', 'onLostPassForm', 'getcaptchaTab' );
$_PLUGINS->registerFunction( 'onLostPassForm', 'onLostPassFormB', 'getcaptchaTab' );
$_PLUGINS->registerFunction( 'onBeforeNewPassword', 'onBeforeNewPassword', 'getcaptchaTab' );

$_PLUGINS->registerFunction( 'onAfterEmailUserForm', 'onAfterEmailUserForm', 'getcaptchaTab' );
$_PLUGINS->registerFunction( 'onBeforeEmailUser', 'onBeforeEmailUser', 'getcaptchaTab' );
}
[/code:1]

2. contact.html.php


Around line 685 (after the contact text textarea) insert this code:
[code:1]// hack - added CB captcha to the contact form
require_once($mosConfig_absolute_path.'/administrator/components/com_comprofiler/plugin.class.php');
require_once($mosConfig_absolute_path.'/components/com_comprofiler/plugin/user/plug_cbcaptcha/cb.captcha.php');
$cbCaptcha = new getcaptchaTab;
$CaptchaImage = $cbCaptcha->_getHTMLcaptcha();
echo "<br />\n" .$CaptchaImage. "<br />\n";
echo " <label for=\"security_code\">" . _UE_CAPTCHA_Label . ":</label>\n";
echo " <br /><input class=\"inputbox\" type=\"text\" name=\"".$cbCaptcha->_getPagingParamName("captcha"«»)."\" id=\"security_code\" value=\"\" size=\"20\" />\n";
// end hack
[/code:1]

3. contact.php

At the top of the file, before the switch statement insert:
[code:1]// hack start a session here for the security images
if ( ! session_id() ) {
session_start();
}
// end hack[/code:1]

Then around line 435 after:
[code:1]if ( !$email || !$text || ( JosIsValidEmail( $email ) == false ) ) {
mosErrorAlert( _CONTACT_FORM_NC );
}[/code:1]
and before:

[code:1] $prefix = sprintf( _ENQUIRY_TEXT, $mosConfig_live_site );
[/code:1]

Insert:
[code:1]// RP hack captcha check
if ( ! (($_SESSION == mosGetParam($_REQUEST,"captcha"«»)) && (!empty($_SESSION)) ) ) {
mosErrorAlert( "Invalid Security Code" );
}
// end hack
[/code:1]

That's it - enjoy a secure contact form.

Post edited by: phlux0r, at: 2007/04/10 04:08

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.716 seconds