News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

Logged out in Joomla

Started by sektor, December 26, 2006, 11:14:32 AM

Previous topic - Next topic

Orstio

QuoteΗ ασφάλεια των κωδικών αναβαθμίστηκε πρόσφατα. Γράψτε ξανά τον κωδικό σας.

I take it this means something along the lines of "Password security has recently been upgraded, please login again."

I logged in again, and the login worked fine.

How do I tell whether or not I am logged into Joomla?

sektor

Yes, the login does indeed work OK.

However, it will log you out of joomla aster a short period of time

You can tell if you are logged in to Joomla by:

On the top menu, at the 2nd choice, if you are logged in to Joomla it displays 4 options to the submenu. If you logged OUT of joomla, it will display 3

Orstio

QuoteHowever, it will log you out of joomla aster a short period of time

Is this PHP 5?

sektor

Nope,

It's apache 2.2 & PHP 4.4.4

Orstio

Is register_long_arrays off?

I'm beginning to wonder if PHP 4.4.4 doesn't also have the same bug as PHP 5....

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

sektor

register_long_arrays isn't even mentioned on the php.ini file

Should i try adding register_long_arrays = on ?


sektor

Ok i did.

I will post results!

Thanx

sektor

Unfortunately, this didn't help.

I got back to the site and i was logged in already (i have had selected remain "always" logged in), but i was logged in only in SMF and not in Joomla.

:(

Orstio

I have only seen something similar to this once.  You wouldn't happen to be on a Windows server?

sektor

Yup,

I am on a dedicated windows 2003 server

Orstio

In smf.php, find this in the integrate_login function:

//Some people are confused by case sensitivity....
$username = $row['username'];

// 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]'");

$lifetime = time() + (60 * $cookielength);
setcookie('usercookie[username]', $username, $lifetime, '/');
setcookie('usercookie[password]', $passwd, $lifetime, '/');
setcookie('sessioncookie', '', -3600, '/');

//Let's make sure this works in both Mambo and Joomla
$sessionCookieName = md5('site' . $mosConfig_live_site);
setcookie($sessionCookieName, '', -3600, '/');

//Joomla 1.0.8 compatibility

if (isset($_VERSION) && $_VERSION->PRODUCT == 'Joomla!' && $_VERSION->DEV_LEVEL >= '8'){
$remCookieName = mosMainFrame::remCookieName_User();
//Joomla 1.0.9 compatibility
                        if ($_VERSION->DEV_LEVEL>='9')
$remCookieValue = mosMainFrame::remCookieValue_User( $username ) . mosMainFrame::remCookieValue_Pass( $passwd ) . $row['id'];
                        else
$remCookieValue = mosMainFrame::remCookieValue_User( $username ) . mosMainFrame::remCookieValue_Pass( $passwd );
setcookie( $remCookieName, $remCookieValue, $lifetime, '/' );
}


//Let's try to minimize the effects of those nasty extra sessions
$sql = mysql_query("
DELETE FROM {$mosConfig_dbprefix}session
WHERE username = '$username'");


Replace it with this:

//Some people are confused by case sensitivity....
$username = $row['username'];
$_POST['remember'] = 'yes';

// Fudge the group stuff.
$mainframe->login($username, $passwd, 'yes');

sektor

Ok, i did. I'll post for results

Will this be fixed in the next version of the bridge?

many thanx

sektor

Unfortunately, if you log out and back in, you get a blank page

I'll switching back to the original file

sektor

[31-Dec-2006 01:22:22] PHP Fatal error:  Call to a member function on a non-object in D:\www\**********\components\com_smf\smf.php on line 656

Orstio

Oops, sorry.  You'll also need to global $mainframe in that function:

function integrate_login($username, $passwd, $cookielength)
{
global $mosConfig_db, $mosConfig_dbprefix, $user_settings, $db_name, $_VERSION, $mainframe;

sektor


sektor

unfortunately that didn't help.

I just logged me out of Joomla again

Orstio

That's very strange, because that code forces the login to use Joomla's native login method. 

sektor

damn it.

any tips you can give me so I am try to find out what's going on?

i'll try to use the original joomla login module to see what happens

Advertisement: