Users aren't logged into to Joomla

Started by BigYellowAV, November 27, 2005, 11:32:01 AM

Previous topic - Next topic

BigYellowAV

I'm running the latest released bridge and it's working perfect, with the exception that the users aren't logged into Joomla. I've made the following change to the two locations in the MOS_SMF.php file:
$sessionCookieName = md5( 'site'.$GLOBALS['mosConfig_live_site'] );
setcookie ($sessionCookieName,"",-3600, "/" );

I've made sure that the appropriate code changes were made to the index.php and subs.php files in my SMF directories. The users are indeed getting created in joomla when they log on via the SMF logon modual. The SAME exact user accounts log into Joomla perfectly when using the normal Joomla log on modual. I believe this to still be a cookie issue. So, my question is, is anyone using the latest version of the bridge with SMF 1.1 RC1 and Joomla 1.0.4? I believe every post that I've read mentioned Joomla 1.0.3 and I'm wondering if something about the cookie has changed yet again. Or if anyone else has any ideas, they'd be appreciated! The bridge is the 3.19 version. I've cleared all cookies dozens of times, I deleted everything from the jos_sessions table, I've un-installed and re-installed everything so many times I've lost count.


Orstio

Thank you for the URL.

What are your settings in the SMF admin panel for the following:

Enable local storage of cookies
Use subdomain independent cookies

BigYellowAV

Both are unchecked. I believe I've tried various combinations as well without any luck.

BigYellowAV

I left the original Joomla log on for the moment. When you log in via the Joomla log on, you should see a couple of additional menu options. When logging on via the mod_smf_login, you logged on to SMF but not Joomla.

BigYellowAV

FYI, if you log on again, I posted a message in the General section that contains the three SMF files that were modified/added.

Orstio

My problem was actually that I could not logout, which usually means that your cookie settings are incorrect for your server configuration.

Can you enable subdomain independent cookies?

BigYellowAV

The setting has been changed. Strange, I don't have any problems logging in and out with my account and one other test account.

BigYellowAV


BigYellowAV

Anyone have the bridge working with SMF 1.1 RC1 and Joomla 1.0.4?

Kindred

yes... running with no errors and 32,000 members...
Сл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."

BigYellowAV

Ok thanks, at least I know it is something local then, just not sure what at this point.

BigYellowAV

I did find that even though it doesn't appear that the user is getting logged into Joomla, the 'Last Visit' date and time is getting updated in the User Manager in Joomla. Thus, I think this still points to a cookie issue. I'm only assuming that a cookie needs to get set, that Joomla can see, and if the cookie exists, they are logged on to Joomla?? Sorry, I'm not all to familiar with the inner workings of the log on process.

BigYellowAV

I THINK I have narrowed down the problem, I believe to the following Select statement  in MOS_SMF.php is failing. Is there some way to debug this code to read the variables?
$request = mysql_query( "SELECT id, gid, block, usertype FROM {$mosConfig_dbprefix}users WHERE username='$username' AND password='$passwd'");
$row = mysql_fetch_array($request);
// fudge the group stuff

$session = $this['_session'];
$session['guest'] = 0;
$session['username'] = $username;
$session['userid'] = intval( $row['id'] );
$session['usertype'] = $row['usertype'];
$session['gid'] = intval( $row['gid'] );


$currentDate = date("Y-m-d\TH:i:s");
mysql_query("UPDATE {$mosConfig_dbprefix}users SET lastvisitDate='$currentDate' where id='$session->userid'");

if ($remember=="yes") {
$lifetime = time() + 32536000;
setcookie( "usercookie[username]", $username, $lifetime, "/" );
setcookie( "usercookie[password]", $passwd, $lifetime, "/" );
    $sessionCookieName = md5( 'site'.$GLOBALS['mosConfig_live_site'] );
setcookie ($sessionCookieName,"",-3600, "/" );

BigYellowAV

#14
Ok, I believe the query is fine, but I'm starting to doubt that the $session = $this['_session']; is working correctly.  I created my own variable, set it to intval( $row['id'] ) and concluded that my variable was set correctly by passing it into to
mysql_query("UPDATE {$mosConfig_dbprefix}users SET lastvisitDate='$currentDate' where id='$myvar'") which then updated the last vist date...


Advertisement: