CB, Captcha and SMF

17 years 1 month ago #34901 by mrritter
CB, Captcha and SMF was created by mrritter
Ran into a snag that I don't know if anyone else has come across, but I'll try to explain.

We are running CB 1.0.2 and SMF, using the Joomla/CB/SMF Bridge from Joomla Hacks.

Anyway, when we added the captcha plug-in, every registration would fail the security code check, everytime no matter what.

I traced it back to CB indirectly. Captcha makes calls to start the session if needed, with session_start, however if SMF hasn't been initialized you'll end up as we did with a session on the filesystem, PHPs default, and a session of the same id in the SMF database session table.

This is not the cleanest fix due to the explict call to a relative path, but you get the idea. Our SMF forum sits at the joomla root under a folder called smf.

I updated the core components/com_comprofiler/comprofiler.php to add the following near the top.

[code:1]if ( !defined('SMF') ) {
global $mosConfig_absolute_path;
require_once( $mosConfig_absolute_path."/smf/SSI.php" );
}[/code:1]

I'm pretty sure this should be being handled by the bridge integration directly with joomla at the root index.php, but while we have that code patched, it wasn't using or setting up the SMF session handler. I'm looking in to this further and will post back with my findings.

Post edited by: mrritter, at: 2007/04/02 23:43

Update:
I added the same bridge code to index2.php that was patched to index.php and that seems to work as well, probably a lot better.

For the curious:[code:1]//JOOMLAHACKS.COM : require SMF's SSI and save/restore globals that it cleans
defined( 'JPATH_BASE' ) or define('JPATH_BASE', $mosConfig_absolute_path);
if (file_exists(JPATH_BASE.'/components/com_smf/smf.class.php')) {
global $context;
require_once(JPATH_BASE.'/components/com_smf/smf.class.php');
$jsmfConfig = jsmfFrontend::loadParams();
jsmfFrontend::«»saveVars($savedVars);
require_once($jsmfConfig->smf_path."/SSI.php"«»);
$jsmf =& jsmfFrontend::«»singleton();
$jsmf->restoreVars($savedVars);
}
[/code:1]

Sorry, I guess this isn't a CB or Captcha issue directly. Hope this helps somebody anyway.

Post edited by: mrritter, at: 2007/04/03 00:08

Please Log in to join the conversation.

17 years 1 month ago #34926 by nant
Replied by nant on topic Re:CB, Captcha and SMF
The SMF session issue has been identified before in the main captcha thread.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.199 seconds