News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

loging in to joomla with the joomla/smf bridge.

Started by Fernanthonies, January 12, 2006, 07:50:04 PM

Previous topic - Next topic

Fernanthonies

ok, i have a quick question about my bridge.  I installed the bridge, and it seems to work well, but its not working exactly as i intended.  I have it to where the smf login shows under the main menu on joomla, and i have smf set to load through joomla, but is unwrapped.  From what i understood, when they were bridged, when you logged in it would log you into joomla and the forums.  As it is now, when i hit login, it takes me right to my forums, and doesn't seem to log me into joomla.

what i wanted, was when i hit login, it stayed on the joomla main page, but gave me the user menu and showed me as logged in, and then if i hit the forum link, it took me to my forum already logged in.  Like i said as soon as i log in it takes me directly to the forum, and if i use the link to go back to joomla, its asks me to log in again.

If this isn't what it does, thats fine, but if there is a way for me to make it work like that i would very much like some help. 

any other info you would need, let me know.

Orstio

This will help:

Version of bridge?

Version of SMF?

A URL, if you can?

Fernanthonies

hehe, i figured i forgot to put in all sorts of helpful info...

im using the bridge 3.19a, and smf 1.0.5, and it the link is http://www.ajfaguild.com/joomla/ [nofollow]


Orstio

OK, great.  :)

You are going to have to modify the file MOS_SMF.php, for two things.  The first is to force a Joomla session cookie to end, and the second is for the redirect, which doesn't work correctly in the unwrapped forum.

Find this in MOS_SMF.php, which is in your SMF Sources directory:

setcookie ("sessioncookie","",-3600, "/" );

And replace it with this:

    $sessionCookieName = md5( 'site'.$GLOBALS['mosConfig_live_site'] );
setcookie ($sessionCookieName,"",-3600, "/" );


There are two places in the file to do this.

Then, we want to fix the redirect back to the Joomla frontpage.  So, in the same file, find this:

  $returncheck="1";

And change it to:

  $returncheck="0";


Fernanthonies

Ok, i had already done the first part of that.  Now that i have changed the returncheck, it just goes back to joomla whenever i log in, and still shows me as a guest.  So if i log in from joomla...nothing really changes, and if i go to the forums and login there, it just takes me back to joomla and gives me the login option.

I've noticed that even if i choose to have smf keep me logged in forever (and this is when i ran it standalone, before i even started using joomla), if i navigated away and came back, i had to log in again.  I've used several other things, such as phpBB, that even if you navigate away and come back, your still loged in.  Can you do this with SMF?

Orstio

#5
QuoteI've noticed that even if i choose to have smf keep me logged in forever (and this is when i ran it standalone, before i even started using joomla), if i navigated away and came back, i had to log in again.  I've used several other things, such as phpBB, that even if you navigate away and come back, your still loged in.  Can you do this with SMF?

What are your settings in SMF for the following?

Enable local storage of cookies:

Use Subdomain independent cookies:

[EDIT] -- I just registered on your site, and logged in.  I closed my browser to make sure the session would end, and then opened the site in a new browser.  I was still logged in.  I was able to logout, and log back in, just fine.

I think any problems you are having with login at this point are related to your browser settings.  You might possibly have a corrupt session cookie.  In order to get rid of the corrupt session cookie, you must close all your browser windows, go to your cookies folder in Windows Explorer, and delete the file with your domain in the filename.  Do not just clear cookies from the browser:  A corrupt cookie will not clear correctly.


Fernanthonies

#7
ok, i checked those both, and now i can stay logged in to smf, which is great.  Still though if i change the returncheck in MOS_SMF, i cant log into the forums, it just takes me back to joomla.  and with it normal, i can log into the forums, but if i try to login from joomla, it still takes me directly to the forums, and if i go back to joomla, i'm logged out again.

EDIT:  If i make the smf forums wrapped, then it shows me logged on in joomla, and gives me the user menu and such.  ultimately what I want is to have that, but not have the forums wrapped.


Fernanthonies


Orstio

That would be because when you installed Joomla, you told it your live site address was:

http://ajfaguild.com/joomla/

Yet, you are typing this into your browser:

http://www.ajfaguild.com/joomla/

Joomla cookies are very finicky about the URL in the browser.  It must exactly match the URL in the $mosConfig_live_site variable, or the authentication will fail.

Fernanthonies

ok, that seems to be working very well.  Of course one problem is when i link back to joomla from the forums, it seems to automatically go to http://www.ajfaguild.com/joomla [nofollow], instead of going to just http://ajfaguild.com [nofollow], even when the link in the source code points there.

would it be best to make $mosConfig_live_site point to http://www.ajfaguild.com/joomla [nofollow], that way it always works as expected?

Orstio

Quotewould it be best to make $mosConfig_live_site point to http://www.ajfaguild.com/joomla, that way it always works as expected?

That would probably be best, considering the circumstances.

Fernanthonies

ok, last newbish question.  I'm still really unfamiliar with php, what would be the best way to go about changing that variable?

Orstio

Open the file configuration.php in your Joomla root directory.  You'll find a line like this:

$mosConfig_live_site = 'http://ajfaguild.com/joomla';

Fernanthonies

#15
Awesome, It works perfectly now, just as i wanted it to.

Thanks a ton man, you were a great help.  Very much appreciated.

Advertisement: