News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Plz HELP!!! Joomla + SMF bridge -- serious session problems

Started by bobbykashyap, March 15, 2006, 09:11:50 PM

Previous topic - Next topic

bobbykashyap

hola folks..
plz help :'( i'm having serious session problems.
Joomla 1.0.7, SMF 1.1RC2, with the latest bridge.
But before going in to bug details... a tiny intro of my setup
I used to have phpBB component from JoomlaStuff website.
Never had session issues. But, As SMF is sexier than phpBB2, I decided to join SMF camp.
I had some trouble migrating the data from phpbb component to SMF.
The phpBB2_to_SMF converter didnt  work for me, as the field names are different between phpBB and phpBB component.
But I tried my novice php hands on tweaking the phpBB2_to_SMF.php converter, and  I was successfully in changing the field map in the converter script... and vola successfully all the data is migrated.

I configured the SMF bridge and user registration. I'm using unwrapped SMF with Bridge registration.
Now, the issue is joomla/SMF session sharing. Its working ridiculously.

1. user logs in on joomla and chooses to go to forum, by clicking on the top menu. In the SMF it does show the welcome message with the user's name. And does even show that user specific details like the topics/postings tht he havent read etc., But even though the attachment viewing and posting is enabled for regular users, the user is neither able to view attachments nor download them.

2. user not able to sign in from the joomla page. It goes to a SMF error page, saying not able to sign in, check the cookies. If the user tries to login @ the SMF error page by clicking on the smf's LOGIN link, the user is taken back to the SMF's home page. But, still the welcome greeting is show as "Hello, Guest".

3. user not able to sign in from the joomla page. It goes to a SMF error page, saying not able to sign in, check the cookies. If the user tries to go back to the Joomla's home page, it shows the user as logged in with the greeting message saying "Hello, xyz".

Those are some of the scenarios that are happening. Heavily irritating!!!

I tried changing server settings in SMF, bridge settings.. but no use.
Thinking that it might be database session, I disabled database sessions... but still the same.

Any gurus to my rescue? plz help!!!
the website is a community portal for pocket pc users. you can visit it at www.indippc.com

sorry, if i have re-posted the error that someone have reported already. but, i couldnt find any thru search. may be the keywords I tried are bad!!  :(

Orstio

QuoteJoomla 1.0.7, SMF 1.1RC2, with the latest bridge.

There is no bridge called "the latest".  Please give an actual version number.

Have you checked the settings in the following post:

http://www.simplemachines.org/community/index.php?topic=63187.msg453559#msg453559

This line:

var smf_session_id = "', $context['session_id'], '";

is missing from your Joomla template.  Did you exclude code from the suggested include in the Joomla template?

bobbykashyap

Hi Orstio... thx for the prompt response.
nope, i havent exclude any code from the template.
lemme double check again.

the version #... i'm kinda lost here.... brand new to SMF camp and lost in version #s  :D
I used the one attached in this posting here
http://www.simplemachines.org/community/index.php?topic=63182.0

Its ver bridge 3.20?

Orstio

So you put this in your Joomla template?

<?php 
global $sc$context$settings;

if (!
defined('SMF')){
require (
"administrator/components/com_smf/config.smf.php");
require (
$smf_path."/SSI.php");
}

$sc = &$context['session_id'];
$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];

mysql_select_db($mosConfig_db);

echo 
'
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?beta4"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
var smf_session_id = "'
$context['session_id'], '";
// ]]></script>'
;

echo 
'
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?rc1" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?beta4" media="print" />
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<link rel="search" href="' 
$scripturl '?action=search" />
<link rel="contents" href="'
$scripturl'" />';
?>



bobbykashyap

yep Orstio, I kept that code in the template... not the 1st one you mentioned.

I disabled GZip compression. previously it was using.

Going thru the postings of all you wonderful guys again, to see if im missing anything.

did i miss anything?

Orstio

The first line I mentioned is only a part of that code that appears to be missing from your template.

Can you copy your template and post it here?


bobbykashyap


<?php
defined
'_VALID_MOS' ) or die( 'Restricted access' );
// needed to seperate the ISO number from the language file constant _ISO
$iso explode'='_ISO );
// xml prolog
echo '<?xml version="1.0" encoding="'$iso[1] .'"?' .'>';
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php mosShowHead(); ?>
<?php
if ( $my->id ) {
initEditor();
}
$collspan_offset = ( mosCountModules'right' ) + mosCountModules'user2' ) ) ? 1;
//script to determine which div setup for layout to use based on module configuration
$user1 0;
$user2 0;
$colspan 0;
$right 0;
// banner combos

//user1 combos
if ( mosCountModules'user1' ) + mosCountModules'user2' ) == 2) {
$user1 2;
$user2 2;
$colspan 3;
} elseif ( 
mosCountModules'user1' ) == ) {
$user1 1;
$colspan 1;
} elseif ( 
mosCountModules'user2' ) == ) {
$user2 1;
$colspan 1;
}

//right based combos
if ( mosCountModules'right' ) and ( empty( $_REQUEST['task'] ) || $_REQUEST['task'] != 'edit' ) ) {
$right 1;
}
?>

<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO?>" />
<link href="<?php echo $mosConfig_live_site;?>/templates/rhuk_solarflare_ii/css/template_css.css" rel="stylesheet" type="text/css"/>
<?php 
global $sc$context$settings;

if (!
defined('SMF')){
require (
"administrator/components/com_smf/config.smf.php");
require (
$smf_path."/SSI.php");
}

$sc = &$context['session_id'];
$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];

mysql_select_db($mosConfig_db);

if(!empty(
$context['page_title']))
     
$mainframe->setPageTitle($context['page_title']);

echo 
'
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?rc2"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
// ]]></script>'
;

echo 
'
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?rc2" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?beta4" media="print" />
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<link rel="search" href="' 
$scripturl '?action=search" />
<link rel="contents" href="'
$scripturl'" />';
?>


</head>
<body>

<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="820">
<tr>
<td class="outline">
  <div id="buttons_outer">
    <div id="buttons_inner">
<div id="buttons">
<?php mosLoadModules 'user3', -1); ?>
</div>
</div>
  </div>
  <div id="search_outer">
    <div id="search_inner">
    <?php mosLoadModules 'user4', -); ?>
    </div>
  </div>
  <div class="clr"></div>
  <div id="header_outer">
  <div id="header">
  &nbsp;
  </div>
  <div id="top_outer">
<div id="top_inner">
<?php
   if ( mosCountModules'top' ) ) {
   mosLoadModules 'top', -);
   } else {
   ?>

  <span class="error">Top Module Empty</span>
  <?php
   }
   ?>

</div>
  </div>
  </div>
  <div id="left_outer">
  <div id="left_inner">
  <?php mosLoadModules 'left', -); ?>
  </div>
  </div>
  <div id="content_outer">
<div id="content_inner">
<?php
   if ( mosCountModules ('banner') ) {
   ?>

  <table border="0" cellpadding="0" cellspacing="0" width="100%" class="content_table">
<tr>
<td>
<div id="banner_inner">
<img src="<?php echo $mosConfig_live_site;?>/templates/rhuk_solarflare_ii/images/advertisement.png" alt="advertisement.png, 0 kB" title="advertisement" border="0" height="8" width="468"/><br />
  <?php mosLoadModules'banner', -); ?><br />
</div>
<div id="poweredby_inner">
<img src="<?php echo $mosConfig_live_site;?>/templates/rhuk_solarflare_ii/images/powered_by.png" alt="powered_by.png, 1 kB" title="powered_by" border="0" height="68" width="165"/><br />
</div>
</td>
</tr>
</table>
<?php
   }
   ?>

  <table border="0" cellpadding="0" cellspacing="0" width="100%" class="content_table">
<tr valign="top">
<td width="99%">
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="content_table">

<?php
if ($colspan 0) {
?>

<tr valign="top">
<?php
   if ( $user1 ) {
   ?>

  <td width="50%">
  <div class="user1_inner">
  <?php mosLoadModules 'user1', -); ?>
  </div>
  </td>
  <?php
   }
   if ( $colspan == 3) {
 ?>

<td width="2">
<img src="<?php echo $mosConfig_live_site;?>/templates/rhuk_solarflare_ii/images/spacer.png" alt="" title="spacer" border="0" height="10" width="2"/>
</td>
<?php
}
   if ( $user2 ) {
   ?>

  <td width="50%">
  <div class="user2_inner">
  <?php mosLoadModules 'user2', -); ?>
  </div>
  </td>
  <?php
   }
?>

</tr>
<tr>
<td colspan="<?php echo $colspan?>">
<img src="<?php echo $mosConfig_live_site;?>/templates/rhuk_solarflare_ii/images/spacer.png" alt="" title="spacer" border="0" height="2" width="100"/><br />
</td>
</tr>
<?php
}
?>

<tr>
<td colspan="<?php echo $colspan?>">
<div id="pathway_text">
<?php mosPathWay(); ?>
</div>
</td>
</tr>
<tr>
<td colspan="<?php echo $colspan?>" class="body_outer">
  <?php mosMainBody(); ?>
</td>
</tr>
</table>


</td>
<?php
if ( $right ) {
   ?>

  <td>
  <div id="right_outer">
  <div id="right_inner">
  <?php mosLoadModules 'right', -); ?>
  </div>
  </div>
  </td>
  <?php
   }
   ?>


</tr>
</table>
  </div>
  </div>
  </td>
  </tr>
  </table>
</div>
<?php include_once( $GLOBALS['mosConfig_absolute_path'] . '/includes/footer.php' ); ?>
<?php mosLoadModules'debug', -);?>
<?php mysql_select_db($GLOBALS['db_name']); ?>
</body>
</html>

Orstio

<?php 
global $sc$context$settings;

if (!
defined('SMF')){
require (
"administrator/components/com_smf/config.smf.php");
require (
$smf_path."/SSI.php");
}

$sc = &$context['session_id'];
$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];

mysql_select_db($mosConfig_db);

if(!empty(
$context['page_title']))
     
$mainframe->setPageTitle($context['page_title']);

echo 
'
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?rc2"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
// ]]></script>'
;

echo 
'
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?rc2" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?beta4" media="print" />
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<link rel="search" href="' 
$scripturl '?action=search" />
<link rel="contents" href="'
$scripturl'" />';
?>



From where did you get that code?

bobbykashyap

its in the README file that came with the bridge file
Bridge Mambo, Joomla SMF 1.1.2.zip

Orstio

No, this is the code that comes in the readme with the bridge 1.1.2:

<?php 
global $sc$context$settings;

if (!
defined('SMF')){
require (
"administrator/components/com_smf/config.smf.php");
require (
$smf_path."/SSI.php");
}

$sc = &$context['session_id'];
$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];

mysql_select_db($mosConfig_db);

echo 
'
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?beta4"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
var smf_session_id = "'
$context['session_id'], '";
// ]]></script>'
;

echo 
'
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?rc1" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?beta4" media="print" />
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<link rel="search" href="' 
$scripturl '?action=search" />
<link rel="contents" href="'
$scripturl'" />';
?>



What you have is not the same.

bobbykashyap

thx Orstio... i'll make the changes.
btw, can i just reinstall the bridge again?
1.1.2 is the latest bridge... rite?

Orstio

Quotebtw, can i just reinstall the bridge again?

Why would you want to do that?

Quote
1.1.2 is the latest bridge... rite?

1.1.2 is the most recent bridge release for SMF 1.1 RC2.  3.19a_stable is the most recent release for SMF 1.0.x.

bobbykashyap

#12
Quote from: Orstio on March 15, 2006, 11:18:54 PM
Quotebtw, can i just reinstall the bridge again?

Why would you want to do that?
:) silly me... thought may be a redeploy of SMF bridge might settle some issues.

after I changed the template with the correct hack you pointed me to...
this is what i face...
>> user log in from the joomla main page.... instead of taking him/her to joomla's "news home", its taking him/her to SMF home.
>> and when we go back to joomla page by manually entering the address in the address bar, it does show the user as logged in to joomla. and when user logout in joomla, even though it shows the bridge "login form", it still shows the "user menu"
>> attachments still a prob!

anything i missed or messed in the templates and stuff?

thx in advance orstio



Orstio

I also have a question about your login module.....

Did you upgrade from a previous bridge?  This does not seem to be the module that comes with the bridge......

When I view your page source, the form tag looks like this:

<form action="index.php?option=com_smf&amp;Itemid=44&amp;action=login2" method="post" style="margin: 3px 1ex 1px 0;">


And it should look like this:

<form action="index.php?option=com_smf&amp;Itemid=44&amp;action=login2" method="post" style="margin: 3px 1ex 1px 0;" onsubmit="hashLoginPassword(this, '5345b5f3ad7f8c74c612b43b5d4166b9');">

bobbykashyap

yep, i installed old bridge initially... then realized theres a new version.
so installed the new one.

to fix these issues, can I do a redeploy... or just overwrite bridge's files?

Orstio

So, you didn't uninstall the old bridge first?  That will probably be your problem.

Which version had you installed previously?

bobbykashyap

Quote from: Orstio on March 15, 2006, 11:40:41 PM
So, you didn't uninstall the old bridge first?  That will probably be your problem.

Which version had you installed previously?

I did uninstall the old bridge. this is the old one i had
http://mamboforge.net/frs/download.php/6471/MOS_SMF_BRIDGEv3.19a_SMF1.1b3.zip

i uninstalled the bridge and installed the one attached to this posting by you @
http://www.simplemachines.org/community/index.php?topic=63182.0

now, after getting help from you... i tried to uninstall and install this one that u attached in the posting.
weird!!! i still see the old form without the hashLoginPassword. ie.,
<form action="index.php?option=com_smf&amp;Itemid=44&amp;action=login2" method="post" style="margin: 3px 1ex 1px 0;">

giving it one more try.
thx pal for the valuable help.. really appreciate all the effort you guys are putting in here.


bobbykashyap

hi orstio...
i uninstalled the version and reinstalled the new bridge attached in this posting
http://www.simplemachines.org/community/index.php?topic=63182.0

but still the form is as follows
<form action="index.php?option=com_smf&amp;Itemid=44&amp;action=login2" method="post" style="margin: 3px 1ex 1px 0;">

the actual file on the server, when i see thru the FTP or cPanel has the
onsubmit="hashLoginPassword(this,.........

any pointers on this for me?

thx

Kindred

When you uninstall the old bridge you must actually uninstall *3* things.
uninstall smf - bridge (component)
uninstall smf bridge registration (component)
uninstall smf login (module)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

bobbykashyap

Quote from: Kindred on March 16, 2006, 08:44:10 AM
When you uninstall the old bridge you must actually uninstall *3* things.
uninstall smf - bridge (component)
uninstall smf bridge registration (component)
uninstall smf login (module)

hi kindred... yep i have done the same. can't remember the order in which i uninstalled those. but i did uninstall all 3.

bobbykashyap

help... help... im stuck... donno where 2 go n what to do  ::)

even though FTP n cPanel file manager shows me the mod_smf login module having the
onsubmit="hashLoginPassword(this,.........
the final login page when the user enters the site is still without the hashLoginPassword.

Also, the user menu is not displayed for users after they login. It happens something like this.
1. user login from joomla welcome page.
2. user doesnt see user menu
3. user click on forums, user is redirected to SMF successfully.
4. from the forums, user click on LOGOUT
5. smf redirects the user back to joomla main page. user can see the login form, showing him as "guest". obvious, coz he clicked on LOGOUT @ smf page. but.... hold on... user can see the user menu now!!

orstio, kindred... any pointers for me?

thanks guys


Orstio

Is the mod package from 3.19a (step 1) still installed in SMF?

bobbykashyap

Quote from: Orstio on March 16, 2006, 08:49:59 PM
Is the mod package from 3.19a (step 1) still installed in SMF?

hi orstio... nope I have uninstalled all 3.19 components and installed 3.20 freshly.
But, I see the following in Joomla administration.
Modules:

Module FileVersionDate
mod_smf_login3.20October 2005

Components

Currently InstalledComponent LinkAuthorVersionDate
Simple Machines Forum Registrationoption=com_smf_registrationTheodore Hildebrandt3.1920.09.2004
SMF Bridgeoption=com_smfSimple Machines3.202005.09.05

SMF Registration still shows 3.19. Something fishy?

Orstio

I'm not talking about the modules and components in Joomla.

Go to your SMF admin panel.  Click on Package Manager.

Is there still a mambo_mod in the Package Manager?

bobbykashyap

Quote from: Orstio on March 16, 2006, 09:15:39 PM
I'm not talking about the modules and components in Joomla.

Go to your SMF admin panel.  Click on Package Manager.

Is there still a mambo_mod in the Package Manager?

:D that definitely gave me a heart attack. I dont see it in my SMF package manager.
i'm definitely missing something!! I did a search in here (SMS > community), i dont see much references about mambo_mod. hmm im totally lost!

Ostrio... plz rescue me  :(

Orstio

If it's not there, then that's a good thing.  1.1.2 does not require a SMF package mod.  3.19a did require a SMF package mod, however, it must be uninstalled in order for 1.1.2 to work correctly.

bobbykashyap

Quote from: Orstio on March 16, 2006, 09:55:00 PM
If it's not there, then that's a good thing.  1.1.2 does not require a SMF package mod.  3.19a did require a SMF package mod, however, it must be uninstalled in order for 1.1.2 to work correctly.

so, any clues for me... on how to proceed?  :)

bobbykashyap

orstio...
will upgradin my Joomla to 1.0.8 and using the new bridge help?

thx for the help.

Kindred

upgrading to Joomla 1.0.8 will require modifications to the bridge code...  considering where you are at now, I would say a big NO...

In addition... 1.1.2 (aka 3.20) is the most recent version of the bridge. There is nothing to upgrade to...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: